From 5ee79f80eb85bbdfb1fc12855c51f42f13798f70 Mon Sep 17 00:00:00 2001 From: Han Xiao Date: Tue, 3 Feb 2026 22:30:49 -0800 Subject: [PATCH] fix: reduce default image dimension from 2000px to 1200px Large images (2000px) consume excessive context tokens when sent to LLMs. 1200px provides sufficient detail for most use cases while significantly reducing token usage. The 5MB byte limit remains unchanged as JPEG compression at 1200px naturally produces smaller files. (cherry picked from commit 40182123dd2673b4b65e6846fa066380f10b781f) --- src/agents/tool-images.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/agents/tool-images.ts b/src/agents/tool-images.ts index 897c82ef4..e66ff29df 100644 --- a/src/agents/tool-images.ts +++ b/src/agents/tool-images.ts @@ -13,7 +13,7 @@ type TextContentBlock = Extract; // // To keep sessions resilient (and avoid "silent" WhatsApp non-replies), we auto-downscale // and recompress base64 image blocks when they exceed these limits. -const MAX_IMAGE_DIMENSION_PX = 2000; +const MAX_IMAGE_DIMENSION_PX = 1200; const MAX_IMAGE_BYTES = 5 * 1024 * 1024; const log = createSubsystemLogger("agents/tool-images");