From 805519befb8355294e24aa68f809af3d8dff1fab Mon Sep 17 00:00:00 2001 From: Chewji <126886556+Chewji9875@users.noreply.github.com> Date: Wed, 24 Jun 2026 08:52:50 +0700 Subject: [PATCH] fix(antigravity): exclude standard Gemini rate limit message from quota exhaustion keywords (#4810) Integrated into release/v3.8.36 --- open-sse/services/antigravity429Engine.ts | 1 - tests/unit/antigravity-429-quota-cooldown.test.ts | 11 +++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/open-sse/services/antigravity429Engine.ts b/open-sse/services/antigravity429Engine.ts index 36364a9e6c..909ed8adff 100644 --- a/open-sse/services/antigravity429Engine.ts +++ b/open-sse/services/antigravity429Engine.ts @@ -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 diff --git a/tests/unit/antigravity-429-quota-cooldown.test.ts b/tests/unit/antigravity-429-quota-cooldown.test.ts index 3791e4ff2a..f0776c9694 100644 --- a/tests/unit/antigravity-429-quota-cooldown.test.ts +++ b/tests/unit/antigravity-429-quota-cooldown.test.ts @@ -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 () => {