Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion open-sse/services/antigravity429Engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions tests/unit/antigravity-429-quota-cooldown.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
Loading