The `content[].thinking` in the thinking mode must be passed back to the API - Claude Code
Quick fix
该问题部分变体仍未修复:可将 CC Switch 升级到已包含 thinking 历史归一化修复的版本;Codex 经 DeepSeek 转发时需使用包含对应转换修复的版本。
Symptom
Section titled “Symptom”API Error: 400 The `content[].thinking` in the thinking mode must be passed back to the API.DeepSeek 等兼容端点要求多轮 thinking 对话回传与历史匹配的 thinking 内容。Claude Code 在上下文压缩、切换供应商或处理工具调用时,可能产生缺失、被裁剪或签名不兼容的 thinking 历史;CC Switch 的协议转换也可能未保留这些内容,因此上游返回 400。相同问题还出现在 Kimi/Moonshot。关闭 thinking 或新建会话在部分报告中可暂时绕开,但会损失推理能力或上下文。
修复进展因客户端路径而异:报告称 CC Switch v3.16.0 修复 DeepSeek 历史归一化,后续扩展到 Kimi/Moonshot;Claude Code 路径另有 v3.20.0 的归一化说明。Codex 转 Anthropic Messages 的路径在 v3.20.3 报告中仍缺少该处理,维护者称 PR #7605 增加了转换后的 DeepSeek/MiMo 归一化。v3.20.1 故障转移热切换引发持续 400 的报告仍为 open,原因分析尚未确认,不能据此认定已修复。
Claude Code 使用 DeepSeek Anthropic 端点时,升级到 v3.16.0 或更高版本;报告建议 v3.16.2。较新的 Claude 路径也有 v3.20.0 起的归一化处理。升级后仍复现时,记录 CC Switch、客户端版本、供应商配置和复现步骤。
Codex 经 CC Switch 转发到 Anthropic Messages 端点时,确认所用版本包含 PR #7605 所述的转换后 thinking 归一化;报告中 v3.20.3 的该路径仍有缺口。现有 issue 未提供已发布版本号,不能据此确定应升级到哪个版本。
若 Claude Code 的旧会话在切换供应商后报错,可新建会话或清除旧上下文再试;用户报告此法对该场景有效。
部分用户报告在 DeepSeek provider 配置中加入 `"thinking": false` 可绕开错误,但这会关闭 thinking;其适用范围和效果并非所有 issue 都确认。
// 配置文件路径未在 issue 中提供{"thinking": false}
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”本页汇总自 13 个真实 issue
- #2277deepseekv4发布了,如何使用cc switch 使之适配claude code终端
- #2282cc switch接deepseek V4报“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"}}”
- #2331[Bug] 临时解决方案Claude Code 与 DeepSeek V4-Flash 工具调用报错:缺少 reasoning_content 导致 400 Invalid Format
- #2401其他模型对话不兼容deepseek对话,如其他模型到额度预警,切换到deepseek,当前对话会报The content[].thinking in the thinking mode must be passed back to the API.
- #3200DeepSeek v4pro报错API400
- #3222DeepSeek V4 /anthropic 端点:tool_use 消息缺少 thinking block 导致 HTTP 400
- #3233API Error: 400 The `content[].thinking` in the thinking mode must be passed back to the API.
- #3263[Bug] DeepSeek Anthropic API thinking block round-trip 导致 400 错误 + Feature Request
- #3287API Error: 400 The content[].thinking in the thinking mode must be passed back to the API.
- #3304API Error: 400 The content[].thinking in the thinking mode must be passed back to the API.
- #3315使用claude desktop配置时调用deepseek写code时会出错
- #7226[Bug] 故障转移热切换模型导致 thinking 模式请求持续 HTTP 400
- #7525使用claude code 桌面调用deepseek 模型报错
- 新建会话能解决这个错误吗?
- 有用户报告退出旧 session 或执行 `/clear` 后重新开始可以解决从其他供应商切换到 DeepSeek 后的错误;这会清除旧会话上下文。
- 关闭 thinking 能绕过错误吗?
- 有用户报告在 DeepSeek provider 配置中设置 `"thinking": false` 后可解决,但会关闭思考模式,且并非所有报告都确认该方法有效。
- Codex 调用 DeepSeek 也会遇到吗?
- 会。issue #7525 报告 Codex 通过 CC Switch 转换到 Anthropic Messages 时,带工具调用的请求仍会报错;维护者称 PR #7605 补上了该转换路径的归一化处理,但该 issue 没有给出对应发布版本。
- 自动故障转移后持续报错,切回原模型也无效怎么办?
- issue #7226 的报告称同一 Codex 会话跨模型热切换后持续 400,只能放弃该会话并重新开始;该 issue 仍为 open,未确认修复方案。
这是一个非官方社区 wiki,与 cc-switch 作者及项目本身无隶属关系。内容整理自项目公开的 GitHub issues。本站不分发任何软件。