Skip to content

[Bug] Claude Code 2.1.153 + DeepSeek V4 → 400 thinking mode error #3246

Description

@leanmore

Self Checks / 自检

CC Switch Version / 版本号

3.15.0

Operating System / 操作系统

Windows

Related App / 涉及应用

Claude Code

Steps to Reproduce / 重现步骤

  1. Configure CC Switch to proxy Claude Code to DeepSeek V4 via Anthropic-compatible endpoint:
    • Set ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic
    • Provide a valid DeepSeek API key
  2. In VS Code, open Claude Code plugin (version 2.1.153)
  3. Start a conversation by asking a question that triggers reasoning_content (e.g., "Explain quantum computing in detail")
  4. After receiving the response, ask a follow-up question (e.g., "Can you elaborate on the second point?")
  5. Observe the error: HTTP 400 with message "The content[].thinking in the thinking mode must be passed back to the API."

Expected Behavior / 期望行为

Claude Code should continue the conversation normally through CC Switch, without any manual intervention regarding thinking mode. The proxy should handle DeepSeek's reasoning_content requirement transparently.

Actual Behavior / 实际行为

After a few turns, Claude Code fails with HTTP 400 error. DeepSeek API rejects the request because the thinking block (or reasoning_content) is missing or malformed.

Additional Context / 补充信息

  • DeepSeek models used: deepseek-v4-pro[1M], deepseek-v4-flash[1M]
  • VS Code version: 1.122.0 (user setup)
    • Commit: 6a49527b96e326fe62fbdb56f60e16877c9aa724
    • Electron: 39.8.8 / Chromium: 142.0.7444.265 / Node.js: 22.22.1
  • CC Switch local proxy port: 127.0.0.1:15721
  • The issue likely stems from protocol incompatibility:
    • DeepSeek V4 enables thinking mode by default, requiring clients to send back reasoning_content in subsequent requests.
    • Claude Code 2.1.153 sends thinking.type="adaptive" (unsupported) and does not preserve/return reasoning_content.
  • Workaround: Bypass CC Switch and use a dedicated proxy like dsv4-cc-proxy (https://gitcode.csdn.net) that handles the thinking mode translation.
  • This problem started after updating Claude Code plugin to 2.1.153. Older versions worked fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions