fix(antigravity): Claude 模型透传 tool_use 的 signature

- Vertex/Google API 需要完整签名链路
- Claude 模型不再清空 tool_use 的 signature
This commit is contained in:
ianshaw
2026-01-03 17:09:50 -08:00
parent b0d41823bd
commit 81b865b89d
2 changed files with 9 additions and 6 deletions

View File

@@ -240,10 +240,13 @@ func buildParts(content json.RawMessage, toolIDToName map[string]string, allowDu
ID: block.ID,
},
}
// 只有 Gemini 模型使用 dummy signature
// Claude 模型不设置 signature避免验证问题
// tool_use 的 signature 处理:
// - Gemini 模型:使用 dummy signature跳过 thought_signature 校验
// - Claude 模型:透传上游返回的真实 signatureVertex/Google 需要完整签名链路)
if allowDummyThought {
part.ThoughtSignature = dummyThoughtSignature
} else if block.Signature != "" && block.Signature != dummyThoughtSignature {
part.ThoughtSignature = block.Signature
}
parts = append(parts, part)