[Bug] Anthropic API Error 400: Thinking blocks cannot be modified on history reconstruction with Opus 4.8
Bug Description
400 "thinking blocks cannot be modified" permanently kills sessions on Opus 4.8 — duplicate of #63147
Environment: Claude Code VS Code extension, Opus 4.8 (1M context), macOS.
Symptom: API Error 400 "messages.N.content.M: thinking or redacted_thinking blocks in the latest assistant message cannot be modified." Once it fires, every resume re-sends the same message and re-hits the identical 400. The window is unrecoverable except by /rewind to a checkpoint before the poisoned turn.
Trigger (intermittent): fires whenever the harness reconstructs or re-sends an assistant turn that contains an extended-thinking block. Observed in one day through three different paths: (1) parallel Bash calls where one errored and cancelled its siblings, stranding tool_use blocks next to a thinking block; (2) a ScheduleWakeup firing async into a thinking-bearing turn; (3) ordinary single tool calls (a Read, a git show) once a turn was already poisoned. The common factor is not the trigger but the precondition: extended thinking on + any history reconstruction.
This matches #63147: thinking text is persisted as empty while the signature is retained, so signature validation fails on re-send.
Impact on Opus 4.8 specifically: adaptive reasoning generates thinking blocks per-turn and cannot be disabled via config. MAX_THINKING_TOKENS only applies to Opus 4.6 / Sonnet 4.6; alwaysThinkingEnabled and Alt+T are display-only. So there is no user-side mitigation beyond shortening sessions and /rewind. Long working/ritual sessions hit auto-compaction, which reconstructs history and reliably triggers the failure.
Request: preserve thinking blocks verbatim across retry/resume/compaction (don't blank the text while keeping the signature), or expose a real per-session thinking off-switch on 4.7/4.8.
Environment Info
- Platform: darwin
- Terminal: vscode
- Version: 2.1.156
- Feedback ID: dc238471-3f29-493b-a188-8e3e678b4952
Errors
[]This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗