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.
1 file changedLine totals unavailable