fix(gateway): harden digest logging and align antigravity ops

- avoid panic by using safe UUID prefix truncation in Gemini digest fallback logs\n- remove unconditional Antigravity 429 full-body debug logs and honor log truncation config\n- align Antigravity quick preset mappings to opus 4.6-thinking targets only\n- restore scope rate-limit aggregation/output in ops availability stats
This commit is contained in:
shaw
2026-02-07 17:12:15 +08:00
parent c4615a1224
commit 1439eb39a9
5 changed files with 57 additions and 10 deletions

View File

@@ -1950,11 +1950,6 @@ func parseAntigravitySmartRetryInfo(body []byte) *antigravitySmartRetryInfo {
isResourceExhausted := status == googleRPCStatusResourceExhausted
isUnavailable := status == googleRPCStatusUnavailable
// 调试日志:打印 RESOURCE_EXHAUSTED 的完整响应
if isResourceExhausted {
log.Printf("[Antigravity-Debug] 429 RESOURCE_EXHAUSTED full body: %s", string(body))
}
if !isResourceExhausted && !isUnavailable {
return nil
}
@@ -2208,8 +2203,10 @@ func (s *AntigravityGatewayService) handleUpstreamError(
// ========== 原有逻辑,保持不变 ==========
// 429 使用 Gemini 格式解析(从 body 解析重置时间)
if statusCode == 429 {
// 调试日志:打印 429 响应的完整 body
log.Printf("[Antigravity-Debug] 429 response full body: %s", string(body))
// 调试日志遵循统一日志开关与长度限制,避免无条件记录完整上游响应体。
if logBody, maxBytes := s.getLogConfig(); logBody {
log.Printf("[Antigravity-Debug] 429 response body: %s", truncateString(string(body), maxBytes))
}
useScopeLimit := quotaScope != ""
resetAt := ParseGeminiRateLimitResetTime(body)