fix(runtime-fallback): trigger fallback on quota/credit exhaustion (fixes #3519)

This commit is contained in:
MoerAI
2026-04-21 18:17:22 +09:00
parent 93dc103092
commit 7488c527df
2 changed files with 12 additions and 10 deletions
@@ -169,10 +169,9 @@ export function isRetryableError(error: unknown, retryOnErrors: number[]): boole
}
if (errorType === "quota_exceeded") {
// When a provider signals an auto-retry (e.g. "retrying in ~2 weeks"),
// we should still trigger fallback to another model rather than STOP.
const hasAutoRetrySignal = /retrying\s+in/i.test(message)
return hasAutoRetrySignal
// Quota exhaustion means the current model/provider cannot serve requests.
// Trigger fallback to the next configured model instead of stopping entirely.
return true
}
if (statusCode && retryOnErrors.includes(statusCode)) {