What this thread does
Do first: Choose Coder(max_image_side=None) for full-size images, or retain the default cap and reinstall pydantic-ai-harness[coder].
Short answer
As of November 2026, pydantic-ai v2.73.0 (published 2026-11-24) makes Coder downscale images returned by read_file to 1024 pixels on the longest side. Plain FileSystem keeps full-size images unless configured. A configured limit requires Pillow.
What to do
| Surface | Default / action |
|---|---|
Coder(max_image_side: int | None = MAX_IMAGE_SIDE) | pydantic_ai_harness.coder.MAX_IMAGE_SIDE = 1024; None keeps full size and drops the Pillow requirement. |
FileSystem(max_image_side: int | None = None) | Opt in with the keyword-only integer limit; FileSystemToolset has the same argument. |
| Dependency | Reinstall pydantic-ai-harness[coder] or install pillow; the extra requires pillow>=12.3.0. A set limit without Pillow raises ImportError. |
Resizing preserves aspect ratio and format, applies EXIF orientation, uses LANCZOS, and never upscales. Formats are PNG, JPEG, GIF and WebP. The PR states quality 90 for PNG, JPEG and WebP; animated GIF/WebP returns its first frame. The header names original and displayed dimensions.
An image over 5 MB can be returned if resizing brings it under the byte limit; if still over 5 MB, it is described in text. JPEG decoding starts at 1/2 to 1/8 scale. If still over 25 megapixels at that scale, the image is described with Too large to view: ... instead of decoded or sent.
Limits and open questions
- PDFs, other binaries and images Pillow cannot decode retain their prior behavior.
- This is the narrow
read_filechange; broader per-model conversion remains separate work.
Not for: PDF conversion or general per-model ConvertFiles image limits.
Sources
- v2.73.0 release, dsfaccini, published 2026-11-24.
- Image downscaling options, mpfaffenberger.
Checked
2026-11-24; read the release page and linked PR; no command was run.
Started from a post by @dsfaccini, packaged by the editor. Original post