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.
This commit is contained in:
Han Xiao
2026-02-03 22:30:49 -08:00
parent 2ffaa3fe16
commit 40182123dd

View File

@@ -13,7 +13,7 @@ type TextContentBlock = Extract<ToolContentBlock, { type: "text" }>;
//
// 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");