thinking enabled but reasoning_content missing Claude Code
Quick fix
关闭 Claude Code 的 Thinking 模式,或升级 cc-switch 解决 Kimi/Moonshot 工具调用报错。
Symptom
Section titled “Symptom”API Error: 400 {"error":{"message":"thinking is enabled but reasoning_content is missing in assistant tool call message at index 2","type":"invalid_request_error"}}当在 Claude Code 中使用 Kimi/Moonshot 或硅基流动等模型进行多轮对话并触发工具调用时,cc-switch 在将 Anthropic 格式转换为 OpenAI 格式的过程中,会直接丢弃 thinking 块。由于 Moonshot 等提供商强制要求:如果启用了 thinking,assistant 的工具调用消息中必须包含 reasoning_content 字段,缺失该字段会导致上游返回 HTTP 400 错误。此问题已在 cc-switch 中通过针对 Kimi/Moonshot 路径注入 reasoning_content(无内容时用 "tool call" 兜底)修复。
升级 cc-switch 到 3.14.2 之后的版本。该版本已针对 Kimi/Moonshot 路径修复了 reasoning_content 丢失的问题,会自动注入该字段或使用占位符兜底。
若暂时无法升级,请在 Claude Code 界面中关闭 Thinking 模式作为临时解决方案,以避免触发该 API 校验。
Affected Versions
Section titled “Affected Versions”ToolClaude Code
Versionpre-3.14.2
PlatformsWindowsmacOSLinux
Source Issues
Section titled “Source Issues”本页汇总自 2 个真实 issue
- 为什么只有调用工具时才会报这个错?
- 错误发生在多轮对话中。当模型生成 thinking 和 tool_use 后,下一轮 Claude Code 将历史记录发回给上游时,转换逻辑丢失了 thinking 内容,导致包含 tool_calls 的 assistant 消息缺少必需的 reasoning_content。
- 修复会影响其他 OpenAI 兼容模型吗?
- 不会。修复方案将 reasoning_content 的注入限制在 Kimi/Moonshot 路径(通过模型名或 base_url 判断),避免了对通用 OpenAI 兼容后端的未知字段污染。
- 为什么使用硅基流动的模型也会报这个错?
- 硅基流动等平台上托管的模型(如 Kimi)同样遵循此 API 规范,当开启 Thinking 模式且发生多轮工具调用时,若请求体缺少 reasoning_content 就会触发 400 错误。
The `content[].thinking` in the thinking该问题部分变体仍未修复:可将 CC Switch 升级到已包含 thinking 历史归一化修复的版本;Codex 经 DeepSeek 转发时需使用包含对应转换修复的版本。会话有概率停止响应(JSONL 不再写入)— Claude Code将 CC Switch 更新到最新 4.0 版本后重试;若仍卡死,可暂时绕过 CC Switch,并提交完整复现信息。The user sent an empty message(Claude Code暂无官方修复:临时用 /export 导出会话后开新会话继续;并做对照测试——绕过 cc-switch 让 Claude Code 直连 Kimi 端点,定位空消息来自哪一层。
这是一个非官方社区 wiki,与 cc-switch 作者及项目本身无隶属关系。内容整理自项目公开的 GitHub issues。本站不分发任何软件。