RC image upload missing media_type causes permanent session API error

Resolved 💬 3 comments Opened Mar 16, 2026 by gisstw Closed Mar 16, 2026

Bug Description

When sending an image from a Remote Control (RC) device to an active Claude Code session, the image is converted to a base64 content block but the media_type field is missing. This causes the Anthropic API to reject the request with a 400 error. Since the malformed image block is persisted in the conversation history, every subsequent API call also fails, making the session permanently unusable.

Steps to Reproduce

  1. Start a Claude Code session (tested on v2.1.76)
  2. Connect via RC from another device (e.g. phone)
  3. Send an image through the RC interface
  4. The session immediately returns an API error and becomes permanently stuck

Error Message

API Error: 400
{
  "type": "error",
  "error": {
    "type": "invalid_request_error",
    "message": "messages.367.content.3.image.source.base64.media_type: Field required"
  }
}

The error points to a base64 image content block that is missing the required media_type field (e.g. image/jpeg, image/png).

Expected Behavior

  • RC image uploads should include the correct media_type based on the image format
  • If media_type cannot be determined, the upload should fail gracefully with a user-facing error rather than corrupting the session

Actual Behavior

  • The image is inserted into the conversation without media_type
  • The API rejects the request with a 400 error
  • The session is permanently broken — every retry hits the same invalid message in history
  • The only workaround is to abandon the session and start a new one

Impact

  • Data loss: all conversation context in the session is effectively lost
  • Recurring: this has happened multiple times across different sessions
  • No recovery path: there is no way to fix the session from within Claude Code

Environment

  • Claude Code version: 2.1.76
  • OS: Ubuntu Linux (x86_64)
  • Platform: CLI via tmux

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗