Session permanently wedged on 400 "thinking blocks cannot be modified" after parallel tool_results

Resolved 💬 2 comments Opened May 28, 2026 by dwats250 Closed Jul 3, 2026

What happened

Session got permanently wedged on a 400 thinking-block error. After a turn that returned two parallel tool_result blocks, the next API request failed with:

API Error: 400 messages.3.content.16: `thinking` or `redacted_thinking` blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response.

The session never recovered. ~15 minutes later, a trivial follow-up prompt re-hit the same error at a different index (messages.1.content.39) — the malformed message history kept getting replayed on every turn, so the session was unusable until I /exit'd.

Repro / context

  • Error appears immediately after two adjacent tool_result user messages (parallel tool calls).
  • Looks like a thinking block is being reordered/modified relative to the original assistant response when the history is reconstructed for the next request.
  • Once it occurs the session is stuck — every subsequent turn (including a no-op prompt) replays the bad history and re-errors.

Version

Claude Code 2.1.153

Expected

Thinking blocks should be preserved in their original position/content when replaying assistant messages, especially following parallel tool results — and a single 400 should not permanently wedge the session.

View original on GitHub ↗

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