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 错误。
第三方模型仍自称 based on GPT-5 - Codex将 `baseInstructions` 覆盖逻辑从 `if profile != ProxyChat` 块移出,使其对 ProxyChat 生效;当前即使配置了 `baseInstructions` 也不会注入。content[].thinking must be passed back升级 cc-switch 到 v3.16.0 或更高版本;临时可回退 Claude Code 到 2.1.150 或关闭 thinking。正文内容频繁出现在 thinking(思考)块内,visible text 块几乎为空升级 cc-switch 至包含 PR #4210 的版本,将预注入 thinking 占位符改为反应式处理即可解决长上下文会话冻结与正文折叠问题。
这是一个非官方社区 wiki,与 cc-switch 作者及项目本身无隶属关系。内容整理自项目公开的 GitHub issues。本站不分发任何软件。