mirror of
https://github.com/jnsahaj/tweakcn.git
synced 2026-08-28 14:58:06 +08:00
d21c8e3d40
Uploaded images were inlined as full-resolution base64 in the message metadata, and the entire chat history is posted on every turn. Two 4MB uploads exceeded the 4.5MB request body cap, so the platform rejected the request before the route ran (FUNCTION_PAYLOAD_TOO_LARGE). - Downscale and re-encode raster uploads client-side (1536px longest edge, WebP with a JPEG fallback, ~300KB target). UI screenshots land around 12KB with imperceptible color drift, so token extraction is unaffected. - Trim images from the oldest messages when the serialized request body would still exceed the budget, rather than failing the request outright. - Raise MAX_IMAGE_FILES from 2 to 5 now that the payload allows it, and wrap the multi-image message preview row so the thumbnails stay legible. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>