Unified · Split
| @@ -104,9 +104,9 @@ func CacheSignature(modelName, text, signature string) { · 103 unmodified lines | ||
| 104 | 104 | return |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | − sc := getOrCreateSession(fmt.Sprintf("%s#%s", GetModelGroup(modelName), text)) | |
| 107 | + text = fmt.Sprintf("%s#%s", GetModelGroup(modelName), text) | |
| 108 | 108 | textHash := hashText(text) |
| 109 | − | |
| 109 | + sc := getOrCreateSession(textHash) | |
| 110 | 110 | sc.mu.Lock() |
| 111 | 111 | defer sc.mu.Unlock() |
| 112 | 112 | |
| @@ -127,8 +127,8 @@ func GetCachedSignature(modelName, text string) string { · 14 unmodified lines | ||
| 127 | 127 | } |
| 128 | 128 | return "" |
| 129 | 129 | } |
| 130 | − | |
| 131 | − val, ok := signatureCache.Load(fmt.Sprintf("%s#%s", family, text)) | |
| 130 | + text = fmt.Sprintf("%s#%s", GetModelGroup(modelName), text) | |
| 131 | + val, ok := signatureCache.Load(hashText(text)) | |
| 132 | 132 | if !ok { |
| 133 | 133 | if family == "gemini" { |
| 134 | 134 | return "skip_thought_signature_validator" |
| @@ -41,7 +41,6 @@ type Params struct { · 40 unmodified lines | ||
| 41 | 41 | HasContent bool // Tracks whether any content (text, thinking, or tool use) has been output |
| 42 | 42 | |
| 43 | 43 | // Signature caching support |
| 44 | − SessionID string // Session ID derived from request for signature caching | |
| 45 | 44 | CurrentThinkingText strings.Builder // Accumulates thinking text for signature caching |
| 46 | 45 | } |
| 47 | 46 | |
| @@ -138,7 +137,7 @@ func ConvertAntigravityResponseToClaude(_ context.Context, _ string, originalReq · 90 unmodified lines | ||
| 138 | 137 | if thoughtSignature := partResult.Get("thoughtSignature"); thoughtSignature.Exists() && thoughtSignature.String() != "" { |
| 139 | 138 | // log.Debug("Branch: signature_delta") |
| 140 | 139 | |
| 141 | − if params.SessionID != "" && params.CurrentThinkingText.Len() > 0 { | |
| 140 | + if params.CurrentThinkingText.Len() > 0 { | |
| 142 | 141 | cache.CacheSignature(modelName, params.CurrentThinkingText.String(), thoughtSignature.String()) |
| 143 | 142 | // log.Debugf("Cached signature for thinking block (sessionID=%s, textLen=%d)", params.SessionID, params.CurrentThinkingText.Len()) |
| 144 | 143 | params.CurrentThinkingText.Reset() |