[v3.8.50] fix(open-sse): add 'has been exhausted' to CREDITS_EXHAUSTED_SIGNALS (fixes #8631) (#8704)

Validated in local merge-train T7 (ungrouped batch 2)
This commit is contained in:
Austin Liu
2026-08-06 18:36:19 +09:30
committed by GitHub
parent ae2f7be16f
commit c4527f97bd
2 changed files with 11 additions and 0 deletions

View File

@@ -184,6 +184,12 @@ export const CREDITS_EXHAUSTED_SIGNALS = [
"out of credits",
"payment required",
"free tier of the model has been exhausted",
// #8631: narrower than a bare "has been exhausted" — that generic phrase also
// appears in Gemini's transient RPM/TPM 429 body ("Resource has been exhausted
// (e.g. check quota)."), which must stay RATE_LIMIT_EXCEEDED, not terminal.
// Anchoring on "tier" keeps free-tier depletion wording matched while excluding
// Gemini's "resource has been exhausted" rate-limit phrasing.
"tier has been exhausted",
// #5239: providers (e.g. DeepSeek/GLM-style) return "Insufficient account balance"
// on a depleted key. 402 is already terminalized by status, but catch non-402
// out-of-credit bodies here too.

View File

@@ -27,6 +27,11 @@ test("classifyProviderError: 400 + billing signal => QUOTA_EXHAUSTED", () => {
error: { message: "insufficient_quota: exceeded your current quota" },
});
assert.equal(result, PROVIDER_ERROR_TYPES.QUOTA_EXHAUSTED);
const resultExhausted = classifyProviderError(400, {
error: { message: "The free tier of the model has been exhausted." },
});
assert.equal(resultExhausted, PROVIDER_ERROR_TYPES.QUOTA_EXHAUSTED);
});
test("classifyProviderError: Kimi billing-cycle 403 => QUOTA_EXHAUSTED", () => {