You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Image attachment media type is trusted as declared; PNG sent as image/jpeg makes every turn fail with 400 #44885
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
Attach a PNG image to a thread under a JPEG type: either through MCP t3_thread_send / t3_thread_launchattachments with mimeType: "image/jpeg", or a pasted/uploaded image that gets stored with a .jpg name.
Send the message on a Claude-backed provider (seen with a Pi provider instance using Claude Sonnet).
Expected behavior
The attachment is sent with its real media type (detected from the file signature), or rejected up front with a clear error.
Actual behavior
The file is stored as <id>.jpg while its bytes are PNG (89 50 4E 47), and it is forwarded as image/jpeg. Anthropic rejects the request:
400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.153.content.1.image.source.base64: The image was specified using the image/jpeg media type, but the image appears to be a image/png image"}}
The image stays in the thread history, so every later turn fails with the same 400 and the thread is stuck.
Two stored attachments on this machine have PNG bytes under a .jpg name: one from the MCP path (mcp-<uuid>.jpg, 2026-11-28) and one from the normal composer path (<uuid>.jpg, 2026-11-24), so the declared type seems to be trusted on both paths.
Impact
Blocks work completely
Version or commit
0.1.12 nightly 20261121.5038 (t3code-nightly-bin)
Environment
CachyOS Linux, desktop app, Wayland; provider: Pi coding agent instance, model Claude Sonnet via an Anthropic-compatible proxy.
Workaround
Correct the media type client-side before the request (we sniff the base64 prefix in a Pi extension), or start a new thread without the image.
Activity