fix(upstream): 跳过 Claude 模型无 signature 的 thinking block

- buildParts 函数检测 thinking block 的 signature
- Claude 模型 (allowDummyThought=false) 时跳过无 signature 的 block
- 记录警告日志以便调试
- Gemini 模型继续使用 dummy signature 兼容方案

修复 Issue 0.1: Claude thinking block signature 缺失错误
This commit is contained in:
IanShaw027
2025-12-31 21:35:41 +08:00
parent 15e676e9cd
commit 35b768b719

View File

@@ -3,6 +3,7 @@ package antigravity
import (
"encoding/json"
"fmt"
"log"
"strings"
"github.com/google/uuid"
@@ -205,6 +206,10 @@ func buildParts(content json.RawMessage, toolIDToName map[string]string, allowDu
// 保留原有 signatureClaude 模型需要有效的 signature
if block.Signature != "" {
part.ThoughtSignature = block.Signature
} else if !allowDummyThought {
// Claude 模型需要有效 signature跳过无 signature 的 thinking block
log.Printf("Warning: skipping thinking block without signature for Claude model")
continue
}
parts = append(parts, part)