fix(antigravity): 扩展 isSignatureRelatedError 检测 thinking 结构错误

- 添加对 "Expected thinking/redacted_thinking" 错误的检测
- 修复 antigravity 服务中 thinking 模式启用时的结构约束错误
- 确保此类错误能触发重试逻辑
This commit is contained in:
ianshaw
2026-01-04 18:34:19 -08:00
parent 118ca5cf6d
commit ae3d6fd776

View File

@@ -574,7 +574,17 @@ func isSignatureRelatedError(respBody []byte) bool {
}
// Keep this intentionally broad: different upstreams may use "signature" or "thought_signature".
return strings.Contains(msg, "thought_signature") || strings.Contains(msg, "signature")
if strings.Contains(msg, "thought_signature") || strings.Contains(msg, "signature") {
return true
}
// Also detect thinking block structural errors:
// "Expected `thinking` or `redacted_thinking`, but found `text`"
if strings.Contains(msg, "expected") && (strings.Contains(msg, "thinking") || strings.Contains(msg, "redacted_thinking")) {
return true
}
return false
}
func extractAntigravityErrorMessage(body []byte) string {