楼主在CC中接入 DeepSeek V4 Pro 时遇到了一个报错,简单记录一下处理过程,供遇到类似问题的佬参考。
问题背景
我的情况是:在 CC 的旧 session 中,通过 cc switch 切换到 deepseek-v4-pro 后,继续执行任务时出现 API 400 报错。
报错信息如下:
API Error: 400 {"error":{"message":"The `content[].thinking` in the thinking mode must be passed back to the API.","type":"invalid_request_error","param":null,"code":"invalid_request_error"}}
问题分析
下面是来自kimi的相关分析
项目 说明 错误类型400 invalid_request_error
根本原因
在 DeepSeek thinking 模式下,模型返回的 reasoning_content 需要在后续请求中回传;但当前 Claude Code 客户端未能正确处理该上下文回传。
触发条件
alwaysThinkingEnabled: true + 使用 deepseek-v4-pro / deepseek-reasoner + 触发 Tool Calls。
解决方案
Step 1:补全 Claude Code 配置
首先检查 Claude Code 的环境变量配置,建议补充以下三项:
{
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
"CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK": "1",
"CLAUDE_CODE_EFFORT_LEVEL": "max"
}
step2: 在旧 session 中使用其他模型执行 compact
- 临时切换到其他可正常运行的模型,对当前旧 session 执行
compact; - compact 完成后,再切回
deepseek-v4-pro,重新执行原来的任务。
4 个帖子 - 3 位参与者