[BUG] Thinking blocks modification error persists in v2.1.20 (post-Jan 25 fix)
Preflight Checklist
- [x] I have searched existing issues and found related issues
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
Related Issues
This appears related to #10199 (main tracking issue), #20711, and #20954. Noting that #20711 had a comment on Jan 25 stating "This issue appears to be fixed now!" - however this bug occurred on Jan 27, suggesting either a regression or incomplete fix.
What's Wrong?
The API returns a 400 error indicating thinking blocks cannot be modified:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.7.content.34: 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":"[redacted]"}
Error Details from Debug Log
- Error occurs in "non-streaming fallback" mode
- The error path shows:
messages.7.content.34indicating:
- 7 messages in conversation history
- 34th content block contains the problematic thinking block
- There's also a preceding error:
output_config: Extra inputs are not permittedwhich may be related - Error repeats on retry attempts
Stack trace:
Error in non-streaming fallback: 400 {...}
at generate (/$bunfs/root/claude:145:37631)
at makeRequest (/$bunfs/root/claude:162:5435)
at processTicksAndRejections (native:7:39)
Steps to Reproduce
Unable to provide exact reproduction steps. The error occurred during a normal conversation session. Based on debug logs:
- Normal session with extended thinking enabled (Opus 4.5 model)
- Multiple tool calls and file operations in conversation
- Non-streaming fallback triggered
- API rejected request due to thinking block modification
Expected Behavior
The conversation should continue without API errors.
Actual Behavior
API returns 400 error, session becomes unrecoverable.
Environment
- Claude Code Version: 2.1.20
- Platform: macOS (Darwin 25.1.0)
- Model: claude-opus-4-5-20251101 (Opus 4.5)
- Date: 2026-01-27
Additional Context
The debug log shows this pattern:
output_config: Extra inputs are not permittederror occurs first- Then
thinking blocks cannot be modifiederror follows - Both errors occur in "non-streaming fallback" path
This may indicate that when the primary streaming request fails and falls back to non-streaming, something in the request construction modifies thinking blocks improperly.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗