Fix combo fallback

This commit is contained in:
decolua
2026-01-19 23:01:39 +07:00
parent 3804357aba
commit e6ca119f5e
2 changed files with 9 additions and 2 deletions
+5
View File
@@ -24,6 +24,11 @@ export function checkFallbackError(status, errorText, backoffLevel = 0) {
const errorStr = typeof errorText === "string" ? errorText : JSON.stringify(errorText);
const lowerError = errorStr.toLowerCase();
// "No credentials" - should fallback to next model in combo
if (lowerError.includes("no credentials")) {
return { shouldFallback: true, cooldownMs: COOLDOWN_MS.notFound };
}
// "Request not allowed" - short cooldown (5s), takes priority over status code
if (lowerError.includes("request not allowed")) {
return { shouldFallback: true, cooldownMs: COOLDOWN_MS.requestNotAllowed };