API returns 500 when user input contains nested message-shaped JSON
Resolved 💬 2 comments Opened Feb 18, 2026 by m-wells Closed Feb 25, 2026
Description
Pasting JSONL conversation transcripts (which contain role/content fields) into the chat input causes HTTP 500 Internal Server Error. The API returns 500 instead of 400, suggesting the input reaches parsing before validation.
Steps to Reproduce
- Copy a JSONL line from a Claude Code transcript (contains
"role": "user","content": "..."fields) - Paste it into the Claude Code chat input
- Observe HTTP 500 Internal Server Error
This is also reproducible indirectly: tool results that render role/content fields in their output can trigger it.
Expected Behavior
The API should either:
- Handle nested message-shaped JSON in user input without error, or
- Return a 400 Bad Request with a clear error message if such input is not supported
Actual Behavior
HTTP 500 Internal Server Error — an unhandled server-side failure.
Environment
- Claude Code v2.1.39
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗