[v3.8.50] fix(antigravity): lock full quota per exact model (#8630)

Validated in local merge-train T6 (ungrouped batch 1)
This commit is contained in:
Éder Costa
2026-08-06 05:24:21 -03:00
committed by GitHub
parent aa7b391386
commit 0b4bc4f4b1
8 changed files with 292 additions and 72 deletions

View File

@@ -1778,7 +1778,10 @@ async function handleSingleModelChat(
result.status,
0,
providerProfile,
{ maxCooldownMs: mlSettings.maxCooldownMs }
{
maxCooldownMs: mlSettings.maxCooldownMs,
scope: provider === "antigravity" ? "exact" : undefined,
}
);
log.info(

View File

@@ -2029,9 +2029,12 @@ export async function markAccountUnavailable(
return { shouldFallback: true, cooldownMs: 0 };
}
const quotaScope = getQuotaScopeLabelForProvider(provider, model);
const usesExactAntigravityLock = provider === "antigravity";
const quotaScope = usesExactAntigravityLock
? "model"
: getQuotaScopeLabelForProvider(provider, model);
const antigravityFamilyInferredBaseCooldownMs =
provider === "antigravity" && quotaScope === "family" && status === 429
!usesExactAntigravityLock && provider === "antigravity" && quotaScope === "family" && status === 429
? ANTIGRAVITY_FAMILY_INFERRED_BASE_COOLDOWN_MS
: null;
const lockout = recordModelLockoutFailure(
@@ -2054,6 +2057,7 @@ export async function markAccountUnavailable(
? fallbackResult.cooldownMs
: (fallbackResult.quotaResetHintMs ?? null),
maxCooldownMs: mlSettings.maxCooldownMs,
scope: usesExactAntigravityLock ? "exact" : undefined,
// #6863 vs #7940: exactCooldownMs above is only ever set from a genuine
// upstream signal (Retry-After/reset header or a parsed quotaResetHintMs) —
// never a synthetic estimate — so it must bypass maxCooldownMs instead of