fix(runtime-fallback): trigger fallback on quota/credit exhaustion (fixes #3519)
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user