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

@@ -103,7 +103,7 @@ func TestBuildParts_ToolUseSignatureHandling(t *testing.T) {
}
})
t.Run("Claude model - no signature for tool_use", func(t *testing.T) {
t.Run("Claude model - preserve valid signature for tool_use", func(t *testing.T) {
toolIDToName := make(map[string]string)
parts, err := buildParts(json.RawMessage(content), toolIDToName, false)
if err != nil {
@@ -112,9 +112,9 @@ func TestBuildParts_ToolUseSignatureHandling(t *testing.T) {
if len(parts) != 1 || parts[0].FunctionCall == nil {
t.Fatalf("expected 1 functionCall part, got %+v", parts)
}
// Claude 模型不设置 signature
if parts[0].ThoughtSignature != "" {
t.Fatalf("expected no tool signature for Claude, got %q", parts[0].ThoughtSignature)
// Claude 模型应透传有效的 signatureVertex/Google 需要完整签名链路)
if parts[0].ThoughtSignature != "sig_tool_abc" {
t.Fatalf("expected preserved tool signature %q, got %q", "sig_tool_abc", parts[0].ThoughtSignature)
}
})
}