[BUG] Bug: 400 error "thinking blocks must be passed back" with third-party compatible endpoints after upgrade to 2.1.152
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Body:
Note: I have reproduced this bug on 2.1.152 (the latest version at time of writing) and downgraded to 2.1.150 as a workaround. I am intentionally pinned to 2.1.150 to avoid the regression.
Description
After upgrading Claude Code from 2.1.150 to 2.1.152, API calls using a third-party Anthropic-compatible endpoint (DeepSeek V3) fail with a 400 error:
API Error: 400 The content[].thinking in the thinking mode must be passed back to the API.
Downgrading back to 2.1.150 resolves the issue immediately. The problem is 100% reproducible across the version boundary.
Steps to Reproduce
Configure Claude Code to use a third-party Anthropic-compatible endpoint (e.g. DeepSeek V3 via ANTHROPIC_BASE_URL)
Run on Claude Code 2.1.150 — works correctly
Upgrade to 2.1.152
Initiate any multi-turn interaction
Error is thrown: 400 The content[].thinking in the thinking mode must be passed back to the API
Expected Behavior
Claude Code should either:
Not send thinking mode parameters to endpoints that don't support the Anthropic thinking protocol, or
Correctly pass thinking blocks back in subsequent turns when thinking mode is active
Actual Behavior
400 error on third-party compatible endpoints after upgrading to 2.1.152. The error suggests that 2.1.152 either began enabling Extended Thinking by default, or introduced a regression in conversation history serialization that drops thinking blocks between turns.
Environment
Claude Code version (broken): 2.1.152
Claude Code version (working): 2.1.150
Endpoint: DeepSeek V3 (Anthropic-compatible API)
ANTHROPIC_BASE_URL: set to DeepSeek endpoint
Workaround
Pin to 2.1.150:
bashnpm install -g @anthropic-ai/claude-code@2.1.150
What Should Happen?
Description
After upgrading Claude Code from 2.1.150 to 2.1.152, API calls using a third-party Anthropic-compatible endpoint (DeepSeek V3) fail with a 400 error:
API Error: 400 The content[].thinking in the thinking mode must be passed back to the API.
Downgrading back to 2.1.150 resolves the issue immediately. The problem is 100% reproducible across the version boundary.
Steps to Reproduce
Configure Claude Code to use a third-party Anthropic-compatible endpoint (e.g. DeepSeek V3 via ANTHROPIC_BASE_URL)
Run on Claude Code 2.1.150 — works correctly
Upgrade to 2.1.152
Initiate any multi-turn interaction
Error is thrown: 400 The content[].thinking in the thinking mode must be passed back to the API
Expected Behavior
Claude Code should either:
Not send thinking mode parameters to endpoints that don't support the Anthropic thinking protocol, or
Correctly pass thinking blocks back in subsequent turns when thinking mode is active
Actual Behavior
400 error on third-party compatible endpoints after upgrading to 2.1.152. The error suggests that 2.1.152 either began enabling Extended Thinking by default, or introduced a regression in conversation history serialization that drops thinking blocks between turns.
Environment
Claude Code version (broken): 2.1.152
Claude Code version (working): 2.1.150
Endpoint: DeepSeek V3 (Anthropic-compatible API)
ANTHROPIC_BASE_URL: set to DeepSeek endpoint
Workaround
Pin to 2.1.150:
bashnpm install -g @anthropic-ai/claude-code@2.1.150
Error Messages/Logs
Steps to Reproduce
Description
After upgrading Claude Code from 2.1.150 to 2.1.152, API calls using a third-party Anthropic-compatible endpoint (DeepSeek V3) fail with a 400 error:
API Error: 400 The content[].thinking in the thinking mode must be passed back to the API.
Downgrading back to 2.1.150 resolves the issue immediately. The problem is 100% reproducible across the version boundary.
Steps to Reproduce
Configure Claude Code to use a third-party Anthropic-compatible endpoint (e.g. DeepSeek V3 via ANTHROPIC_BASE_URL)
Run on Claude Code 2.1.150 — works correctly
Upgrade to 2.1.152
Initiate any multi-turn interaction
Error is thrown: 400 The content[].thinking in the thinking mode must be passed back to the API
Expected Behavior
Claude Code should either:
Not send thinking mode parameters to endpoints that don't support the Anthropic thinking protocol, or
Correctly pass thinking blocks back in subsequent turns when thinking mode is active
Actual Behavior
400 error on third-party compatible endpoints after upgrading to 2.1.152. The error suggests that 2.1.152 either began enabling Extended Thinking by default, or introduced a regression in conversation history serialization that drops thinking blocks between turns.
Environment
Claude Code version (broken): 2.1.152
Claude Code version (working): 2.1.150
Endpoint: DeepSeek V3 (Anthropic-compatible API)
ANTHROPIC_BASE_URL: set to DeepSeek endpoint
Workaround
Pin to 2.1.150:
bashnpm install -g @anthropic-ai/claude-code@2.1.150
Claude Model
Other
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.150
Platform
Other
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗