fix: add cost nil guard to Anthropic/Antigravity RecordUsage paths

- Apply same nil-pointer protection as OpenAI path
- Remove unused accessToken/proxyURL params from checkAccountCredits
This commit is contained in:
erio
2026-04-01 17:13:31 +08:00
parent c9145ad4d8
commit 35a9290528
3 changed files with 21 additions and 17 deletions

View File

@@ -558,7 +558,7 @@ func (s *AntigravityGatewayService) antigravityRetryLoop(p antigravityRetryLoopP
p.account.IsOveragesEnabled() && !p.account.isCreditsExhausted() &&
p.account.isModelRateLimitedWithContext(p.ctx, p.requestedModel) {
// Check actual credits balance before injection
if !s.checkAccountCredits(p.ctx, p.account, p.accessToken, p.proxyURL) {
if !s.checkAccountCredits(p.ctx, p.account) {
// No credits available - mark as exhausted and skip injection
s.setCreditsExhausted(p.ctx, p.account)
logger.LegacyPrintf("service.antigravity_gateway", "%s pre_check: no_credits_available account=%d (skipping credits injection)",