Skip to content

content[].thinking must be passed back - CC Switch

Quick fix

Upgrade cc-switch to v3.16.0 or newer. As a stopgap, roll Claude Code back to 2.1.150 or turn thinking off.

Error output
API Error: 400 The `content[].thinking` in the thinking mode must be passed back to the API.

When Claude Code forwards through cc-switch to an Anthropic-compatible endpoint such as DeepSeek or Kimi/Moonshot, requests start returning 400 after several tool-call turns. These reasoning models have thinking mode on by default and require every assistant message in the history containing a tool_use to carry its thinking block back as well. But during context compaction, a session switch, or when history from an old provider is mixed in, Claude Code may strip, omit, or keep an incompatible thinking/redacted_thinking/signature, so DeepSeek/Kimi rejects the request. Some users also see variants such as messages[1].role must be either 'user' or 'assistant', but got 'system', which still comes down to thinking and history format conversion. cc-switch v3.16.0 fixed this by normalising tool-thinking history, and later versions extended it to Kimi/Moonshot.

  1. Preferred: upgrade cc-switch to v3.16.0 or newer, ideally at least v3.16.2. A maintainer confirmed that version normalises tool-thinking history for the DeepSeek Anthropic-compatible endpoint, later extended to Kimi/Moonshot.

  2. If it persists after upgrading, quit the current Claude Code session and start a new conversation. An old session mixing tool_use history from another provider readily triggers this when you switch to DeepSeek/Kimi.

  3. Stopgap one: add "thinking": false to the DeepSeek provider config in cc-switch to turn thinking mode off. It avoids the 400 but loses the reasoning trace.

    cc-switch provider config
    {
    "includeCoAuthoredBy": false,
    "thinking": false
    }
  4. Stopgap two: roll the Claude Code CLI back to 2.1.150. Several users confirm the error stops after rolling back.

    shell
    npm install -g @anthropic-ai/[email protected]
  5. If you use the Claude Code VS Code plugin, roll the plugin version back too — users report the command line working while the VS Code plugin still errors.

ToolClaude Code
Versioncc-switch 3.14.1 - 3.15.0;v3.16.0 修复
PlatformsmacOSWindowsLinux
Why does a new conversation work while an old one errors after switching to DeepSeek?
DeepSeek V4 thinking mode does not accept old Claude Code session history carried over from another provider. The tool_use turns in that history lack the thinking block DeepSeek requires, so quitting the session and starting fresh usually works around it.
Is turning thinking off the best answer?
Not long-term. Setting "thinking": false only avoids the API validation error, at the cost of the model's reasoning. Upgrading cc-switch to v3.16.0 or newer comes first.
The Claude Code command line works but the VS Code plugin still errors. What now?
Roll back or update the Claude Code plugin in VS Code as well. Users report the command line recovering while the official VS Code plugin still triggers this 400 consistently.
Does the same error hit Kimi or Moonshot?
Yes. It is not limited to DeepSeek — the Kimi k2 / Moonshot Anthropic-compatible endpoints can also return 400 over how the thinking block is passed back. cc-switch later extended the normalisation fix to Kimi/Moonshot.
Where do I turn the model's thinking off?
Add "thinking": false to the matching provider config in cc-switch. If the page has no direct toggle, edit the provider JSON config.

This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.