claude-code - 💡(How to fix) Fix Opus 4.8: backgrounded task completions (subagents AND Bash) crash with 400 "thinking blocks cannot be modified"

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

400 API Error: "thinking" or "redacted_thinking" blocks in the last assistant message cannot be modified. These blocks must remain as they were in the original response.

Fix Action

Fix / Workaround

When dispatching backgrounded subagents (e.g. the Explore agent, or Agent tool with run_in_background: true), the subagent immediately crashes on its first turn with:

This appears tied to the Opus 4.8 release — extended-thinking signed blocks must be replayed byte-for-byte, and the subagent-dispatch/replay path seems to be mutating them (or re-ordering/re-encoding), causing the API to hard-reject.

Backgrounded subagents run normally; signed thinking/redacted_thinking blocks are preserved verbatim across the dispatch/replay boundary.

Code Example

400 API Error: "thinking" or "redacted_thinking" blocks in the last assistant
message cannot be modified. These blocks must remain as they were in the
original response.
RAW_BUFFERClick to expand / collapse

What happened

When dispatching backgrounded subagents (e.g. the Explore agent, or Agent tool with run_in_background: true), the subagent immediately crashes on its first turn with:

400 API Error: "thinking" or "redacted_thinking" blocks in the last assistant
message cannot be modified. These blocks must remain as they were in the
original response.

Both a backgrounded Explore agent and a backgrounded general Agent failed with the identical error. The subagents never executed any tool calls — they died on the first model turn. Retrying produces the same error every time (deterministic, not transient).

This appears tied to the Opus 4.8 release — extended-thinking signed blocks must be replayed byte-for-byte, and the subagent-dispatch/replay path seems to be mutating them (or re-ordering/re-encoding), causing the API to hard-reject.

Expected

Backgrounded subagents run normally; signed thinking/redacted_thinking blocks are preserved verbatim across the dispatch/replay boundary.

Repro

  1. Model: Opus 4.8 (claude-opus-4-8), extended thinking on.
  2. Ask the main agent to dispatch a backgrounded subagent (e.g. "find file X" via Explore, or any Agent call with run_in_background: true).
  3. Subagent fails immediately with the 400 above.

Impact

Backgrounded subagent dispatch is fully broken under Opus 4.8 — any workflow that fans work out to background Explore/Agent helpers fails. Inline (non-backgrounded) tool calls in the main session are unaffected and work as a temporary workaround.

Environment

  • Claude Code: 2.1.154
  • Model: Opus 4.8 (claude-opus-4-8), 1M context
  • Platform: macOS (Darwin 25.5.0)

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