fix(antigravity): exclude standard Gemini rate limit message from quota exhaustion keywords (#4810)

Integrated into release/v3.8.36
This commit is contained in:
Chewji
2026-06-24 08:52:50 +07:00
committed by GitHub
parent 9a5627a4a6
commit 805519befb
2 changed files with 11 additions and 1 deletions

View File

@@ -53,7 +53,6 @@ const CREDITS_EXHAUSTED_KEYWORDS = [
"minimumcreditamountforusage",
"minimum credit amount for usage",
"minimum credit",
"resource has been exhausted",
];
const SHORT_COOLDOWN_MS = 5 * 60 * 1000; // 5 minutes

View File

@@ -55,6 +55,17 @@ test("classify429: AG 'Individual quota reached' message → quota_exhausted", (
assert.equal(classify429(msg), "quota_exhausted");
});
test("classify429: standard Gemini rate limit 'resource has been exhausted' -> rate_limited or unknown, not quota_exhausted", () => {
const msg =
"RESOURCE_EXHAUSTED: Resource has been exhausted (e.g. queries per minute limit was reached).";
const result = classify429(msg);
assert.notEqual(
result,
"quota_exhausted",
"RESOURCE_EXHAUSTED rate limit should not be classified as quota_exhausted"
);
});
// ── DB persistence (the missing wire — Bug #2) ───────────────────────────────
test("markConnectionQuotaExhausted persists 24h cooldown; isConnectionRateLimited returns true", async () => {