mirror of
https://github.com/decolua/9router.git
synced 2026-05-08 12:01:28 +00:00
fix: treat Kiro 400 'improperly formed request' as model-unavailable (#386)
Kiro returns HTTP 400 with 'Improperly formed request (reset after Xs)' when a model is not available on that account's subscription tier. Previously this fell through to COOLDOWN_MS.transient (30s), causing rapid retries on all accounts before failing — all accounts get locked simultaneously with no actual fallback. Treating this as paymentRequired (2min cooldown) ensures: 1. The model is locked on that account for 2min (proper cooldown) 2. The next available account is tried immediately 3. If all accounts hit the same 400, 9Router falls through to the next provider in the combo Fixes #384
This commit is contained in:
@@ -32,6 +32,12 @@ export function checkFallbackError(status, errorText, backoffLevel = 0) {
|
||||
return { shouldFallback: true, cooldownMs: COOLDOWN_MS.requestNotAllowed };
|
||||
}
|
||||
|
||||
// Kiro: "improperly formed request" = model not available on this account tier
|
||||
// Treat as paymentRequired (long cooldown) so the model is locked and fallback occurs
|
||||
if (lowerError.includes("improperly formed request")) {
|
||||
return { shouldFallback: true, cooldownMs: COOLDOWN_MS.paymentRequired };
|
||||
}
|
||||
|
||||
// Rate limit keywords - exponential backoff
|
||||
if (
|
||||
lowerError.includes("rate limit") ||
|
||||
|
||||
Reference in New Issue
Block a user