跳转到内容

Function call is missing a thought_signature Claude Code

Quick fix

使用社区补丁 cc-switch-gemini-fixer 或在历史消息中注入 skip_thought_signature_validator 以绕过 Gemini 工具调用的签名验证。

报错原文
API Error: 400 Function call is missing a thought_signature in functionCall parts. This is required for tools to work correctly, and missing thought_signature may lead to degraded model performance. Additional data, function call `default_api:Bash` , position 64. Please refer to https://ai.google.dev/gemini-api/docs/thought-signatures for more details.

Google Gemini 3.x 及带 Thinking 功能的模型在工具调用时采用无状态推理链,产生 functionCall 时会包含加密凭证 thought_signature,并要求后续回传 functionResponse 时必须原样携带。CC Switch 在将 Anthropic 协议转译为 Gemini 格式时,在消息上下文透传中丢弃了该字段,导致 Google API 拒绝请求并返回 400 错误。另外,部分用户遇到的 User location is not supported 属于 API 地区限制,是与此不同的另一个 400 错误变种。

  1. 下载并运行社区提供的临时修复补丁 cc-switch-gemini-fixer,该程序会自动处理 Gemini 响应的签名透传。

  2. 或者在代理转换层构造包含 functionCall 的历史消息时,默认注入 "thought_signature": "skip_thought_signature_validator" 以绕过官方验证。

ToolClaude Code / Codex
Version3.16.1 - 3.19.2
PlatformsWindowsmacOS
Mac 系统可以使用这个补丁吗?
可以,社区开发者已提供适用于 macOS 的 cc-switch-gemini-fixer 补丁版本。
报错提示 User location is not supported 也是签名问题吗?
不是。这是 Google Gemini API 对当前网络所在地区的限制,与 thought_signature 缺失无关,需要更换支持地区的代理节点。

这是一个非官方社区 wiki,与 cc-switch 作者及项目本身无隶属关系。内容整理自项目公开的 GitHub issues。本站不分发任何软件。