Edge Cases & Failure Modes

Scenario Expected Behavior
Image is > 5MB Resize/compress before sending to Minimax (max 2MB, 1024px longest side)
Image is HEIC (iPhone format) Convert to JPEG before sending, or ensure Minimax accepts HEIC
Image is corrupted or unreadable Show “[Image — could not describe]”, log error
Minimax API returns gibberish Validate description (non-empty, printable chars) before caching; if invalid, retry once
Minimax API rate-limits (429) Back off for 60 seconds, show “[Describing image… — retrying]”
Message has both text and image Show the text bubble normally, then the image description bubble(s) below it
Image description is longer than 2 lines Truncate with “…” in chat list preview; wrap normally in message view
User toggles descriptions off while descriptions are pending Cancel pending API calls, hide placeholders, do not cache
Relay restarts while descriptions are pending Pending descriptions are lost; next poll will re-detect and re-describe (cache will prevent duplicate API calls for already-completed ones)
Attachment GUID is missing or malformed Skip description, show generic “[Image]” placeholder
Same image is sent in two different chats Describe once, cache by GUID, reuse in both chats
Image is a Live Photo (HEIC + MOV) Describe the HEIC still frame, ignore the MOV; show “[Live Photo]” subtitle
Image is a GIF Minimax may or may not describe animated images; if it fails, show “[GIF]” placeholder
User sends an image from AQUAPING (future) When AQUAPING supports sending images, the outgoing image should also be described