Constant 400 errors: thinking blocks modified when background subagent completes

Resolved 💬 3 comments Opened Feb 6, 2026 by ryanmish Closed Feb 9, 2026

Bug Description

Getting constant 400 errors when background subagents (spawned via Task tool with run_in_background: true) complete and their results are folded back into the main conversation context.

Error Message

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.9.content.28: `thinking` or `redacted_thinking` blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response."},"request_id":"req_011CXqrmANY8n7qfaw6rBFcY"}

Reproduction

  1. Use Claude Code with extended thinking enabled (e.g. claude-opus-4-6)
  2. Spawn a background subagent using the Task tool with run_in_background: true
  3. When the subagent completes, the task notification gets injected into the conversation
  4. This triggers a 400 error because thinking/redacted_thinking blocks in the assistant message history get modified during the process

Details

  • The error references messages.9.content.28, pointing to a specific thinking block in the message history
  • It appears that when subagent completion results are merged back into the conversation, the thinking/redacted_thinking blocks from the parent conversation's assistant messages are being altered
  • The API correctly rejects this since thinking blocks must remain unmodified from the original response
  • This makes the background subagent workflow largely unusable since it errors every time an agent completes

Expected Behavior

Background subagent completion should not modify existing thinking/redacted_thinking blocks in the parent conversation's message history. The task notification should be injected without altering prior assistant message content.

Environment

  • Claude Code CLI
  • Model: claude-opus-4-6
  • macOS (Darwin 24.6.0)

View original on GitHub ↗

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