Files
zed/crates/language_model
Daniel Strobusch d4559da42d language_model: Fix ImageSize storing pre-downscale dimensions (#54357)
When images are resized to meet provider size constraints (Anthropic's
1568px limit or the 5MB encoded-PNG cap), the stored ImageSize was still
recording the original width/height rather than the final post-downscale
dimensions. This caused incorrect token estimation via estimate_tokens()
since it uses width * height / 750.

Use processed_image.dimensions() after all downscale passes so that
ImageSize reflects the actual image sent to the provider.

Release Notes:

- Fixed an issue where token estimation would be incorrect in case where
the thread contained downscaled images.
2026-04-21 12:36:22 +02:00
..