Commit 35b768b7 authored by IanShaw027's avatar IanShaw027
Browse files

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 缺失错误
parent 15e676e9
......@@ -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
// 保留原有 signature(Claude 模型需要有效的 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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment