Interleaved thinking + multi-tool turn corrupts thinking block (text blanked, signature kept) → permanent 400 'blocks must remain as they were'

Resolved 💬 2 comments Opened May 28, 2026 by Slider-8 Closed May 28, 2026

Summary

A single assistant turn that interleaves thinking blocks with multiple tool_use calls can get persisted with the thinking text blanked to "" while the original signature is retained. On the next request the API rejects it with:

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

Because the corrupted assistant turn stays in conversation history, every subsequent request re-sends it and fails — the session is permanently wedged. Re-prompting just reproduces the same 400.

Environment

  • Claude Code: 2.1.150
  • OS: Windows 11 Pro (10.0.26200), shell: Git Bash
  • showThinkingSummaries: true
  • Extended/interleaved thinking active, multiple tools in one turn

What the transcript shows

The offending assistant turn (from the session JSONL) interleaves thinking and tool calls:

assistant THINKING
assistant tool_use:Bash
assistant THINKING
assistant tool_use:ToolSearch
assistant tool_use:WebFetch
assistant tool_use:BashOutput
user      tool_result x4
assistant THINKING
assistant text  -> API Error 400

Every thinking block in that turn is stored as:

{ "type": "thinking", "thinking": "", "signature": "<~292-696 char signature present>" }

i.e. the thinking text is an empty string but the signature is intact. Since the signature is computed over the original thinking content, the blank text no longer matches the signature, and the API correctly rejects the modified block.

The error then repeats on every following user prompt (3x in my session), confirming the poisoned turn is re-sent each time and the conversation cannot make progress.

Expected

The client should either preserve thinking blocks verbatim (text + signature) across an interleaved-thinking + multi-tool round-trip, or drop the block entirely (text and signature) — never keep a signature attached to emptied/summarized thinking text.

Repro (observed conditions)

  1. showThinkingSummaries: true, extended thinking enabled.
  2. One assistant turn emits multiple interleaved thinking + tool_use blocks (≥4 tools, mixed Bash/WebFetch/etc.).
  3. Tool results return; next assistant step triggers the 400.

Workaround

Setting showThinkingSummaries: false avoids the error class (no signed thinking blocks retained in history). The wedged session cannot be recovered — --continue/--fork re-send the corrupt turn and keep failing.

View original on GitHub ↗

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