Function call is missing a thought_signature - Claude Code
Quick fix
在 Claude Desktop 代理模式下使用 Gemini Native 触发工具调用时,因会话 ID 不匹配导致 thought_signature 丢失,需等待官方修复。
Symptom
Section titled “Symptom”API Error: 400 Function call is missing a thought_signature in functionCall parts.在 cc-switch v3.16.0 至 v3.16.3 版本中,当通过 Claude Desktop 或 Claude App 的代理模式调用 Gemini Native 模型并触发工具调用(如 default_api:Bash 或 MCP 工具)时,会触发 HTTP 400 错误。根本原因在于 Gemini 的 shadow replay 机制依赖 (provider_id, session_id) 作为键值,但 Claude Desktop 的工具调用请求可能无法提供稳定的客户端 session id。这导致 cc-switch 将 assistant 回合记录在一个生成的 session key 下,而后续的工具结果请求却使用了另一个 key,从而无法恢复存储的 thoughtSignature,最终上游 Gemini 返回 400 错误。此问题在 #4492 中被标记为 #5415 的重复项。
目前该问题在 v3.16.3 中尚未修复。由于这是 cc-switch 处理 Gemini Native 多轮工具调用时的已知 Bug,请关注主 Issue #5415 以获取修复进展。
Affected Versions
Section titled “Affected Versions”ToolClaude Code / Claude Desktop
Version3.16.0 - 3.16.3
PlatformsmacOS
Source Issues
Section titled “Source Issues”本页汇总自 2 个真实 issue
- 为什么 v3.16.0 的更新日志中说已经修复了 thought_signature 问题,但我还是遇到了?
- v3.16.0 修复了部分场景,但 Claude Desktop 代理模式下的工具调用(如 Bash、Glob 或 MCP 工具)由于 session id 不稳定,触发了未被覆盖的代码路径,导致问题依然存在。
Failed to parse Hermes config升级 cc-switch 至 v3.16.3+ 以修复 CRLF 换行导致的配置追加 bug,或手动删除 config.yaml 中的重复键。Function call is missing使用社区补丁 cc-switch-gemini-fixer 或在历史消息中注入 skip_thought_signature_validator 以绕过 Gemini 工具调用的签名验证。Gtk-CRITICAL: gtk_widget_get_scale_factor 失败在 Linux 或 WSL2 中运行 cc-switch 遇到 GTK 断言失败时,请修改 settings.json 关闭静默启动,或清理残留配置重装。
这是一个非官方社区 wiki,与 cc-switch 作者及项目本身无隶属关系。内容整理自项目公开的 GitHub issues。本站不分发任何软件。