claude-code - 💡(How to fix) Fix Server-side model upgrade (Opus 4.7→4.8) wedges in-flight sessions with `thinking blocks cannot be modified` 400

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

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.

Fix Action

Fix / Workaround

Workarounds

Code Example

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.
RAW_BUFFERClick to expand / collapse

Summary

When the served model changes underneath an existing session (e.g. Opus 4.7 → 4.8), continuing that session fails fatally 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.

Thinking-block signatures are bound to the producing model, so 4.7-signed blocks already in the conversation history don't validate when the turn is continued on 4.8. There is no user-side fix-forward — only /clear (history is unrecoverable).

Expected behavior

On a model transition, the harness should reconcile prior thinking blocks (strip/drop the unvalidatable ones — they're internal reasoning state, not user content) rather than surface a fatal API error mid-turn. A server-side default model bump should not be able to corrupt a user's in-flight session.

Steps to reproduce / evidence

  • Session started on Opus 4.7 (Claude Code v2.1.153), then continued after the served model moved to Opus 4.8.
  • The failure is not content-dependent: the tool calls in flight (two innocuous URLs returning 404 and []) are coincidental. Every retry re-sends the same 4.7-signed assistant turn and dies at the same content.M.
  • A fresh session born on 4.8 runs the identical tool calls with no error, which isolates the cause to pre-existing 4.7-signed thinking blocks in history rather than the request content.

Workarounds

  • /clear to discard the corrupted history (prior reasoning lost).
  • Disable extended thinking, which removes signed blocks from the request entirely.

Environment

  • Claude Code v2.1.153
  • Model transition: Opus 4.7 → Opus 4.8 (server-side)

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING