[Bug] Session requires reset after initial error occurrence
Bug Description
Bug: Persistent "image cannot be empty" error after initial occurrence - requires session reset
Environment: Claude Code CLI
Error Message:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.186.content.1.image.source.base64: image
cannot be empty"}}
Description:
After an initial occurrence of this error, the session becomes corrupted and continues to fail with the same error on every
subsequent request—regardless of whether the new message contains an image or not. The only workaround is to completely reset the
session.
Steps to Reproduce:
- Use Claude Code normally until the error first occurs (trigger unclear)
- After the error appears, send any follow-up message (text-only, no image)
- The same "image cannot be empty" error repeats
Expected Behavior:
- Text-only messages should not trigger image validation errors
- A single failed request should not corrupt subsequent requests in the session
Actual Behavior:
- Once the error occurs, it persists indefinitely
- Session becomes unusable without a full reset
- Error references messages.186.content.1.image.source.base64 suggesting the conversation history contains a corrupted/empty image
reference that gets resent with each request
Suspected Cause:
The conversation context appears to retain a malformed image reference (empty base64 data) that gets included in all subsequent API
calls, causing repeated validation failures.
Environment Info
- Platform: darwin
- Terminal: iTerm.app
- Version: 2.1.9
- Feedback ID: 83b5824b-5cc8-46f2-9747-41802a9ff991
Errors
[{"error":"MaxFileReadTokenExceededError: File content (33311 tokens) exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.\n at dx_ (/$bunfs/root/claude:1571:13405)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-01-16T06:59:46.623Z"},{"error":"Unable to determine image format","timestamp":"2026-01-16T08:05:04.887Z"},{"error":"Unable to determine image format","timestamp":"2026-01-16T08:05:05.607Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.186.content.1.image.source.base64: image cannot be empty\"},\"request_id\":\"req_011CXAiBRNQbvs3yxMB8iQdZ\"}\n at generate (/$bunfs/root/claude:939:2085)\n at makeRequest (/$bunfs/root/claude:956:5435)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-01-16T08:05:06.399Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.186.content.1.image.source.base64: image cannot be empty\"},\"request_id\":\"req_011CXAiC55nhb4F6nT2Km4ZB\"}\n at generate (/$bunfs/root/claude:939:2085)\n at makeRequest (/$bunfs/root/claude:956:5435)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-01-16T08:05:15.117Z"}]This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗