Files
Sahaj Jain d21c8e3d40 fix: keep AI chat image payloads under the serverless body limit
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>
2026-08-17 20:50:38 +05:30
..
2025-06-29 00:47:13 +05:30
2025-04-25 23:32:45 +05:30
2025-04-25 23:32:45 +05:30
2025-10-01 16:31:10 +05:30
2025-05-31 20:08:53 +05:30
2025-07-18 20:40:09 +05:30
2025-07-18 20:40:09 +05:30
2025-04-25 23:32:45 +05:30