fix: handle 400 status in failover to enable model fallback (#1879)

This commit is contained in:
Oren
2026-02-09 09:12:06 +02:00
committed by GitHub
parent 5e55a181b7
commit 71b4be8799
3 changed files with 5 additions and 0 deletions

View File

@@ -160,6 +160,9 @@ export function resolveFailoverReasonFromError(err: unknown): FailoverReason | n
if (status === 408) {
return "timeout";
}
if (status === 400) {
return "format";
}
const code = (getErrorCode(err) ?? "").toUpperCase();
if (["ETIMEDOUT", "ESOCKETTIMEDOUT", "ECONNRESET", "ECONNABORTED"].includes(code)) {