From 037d013af87b07a311a7e848132fe2c704b4067e Mon Sep 17 00:00:00 2001 From: Ryan <215719061+East-rayyy@users.noreply.github.com> Date: Mon, 23 Mar 2026 06:25:35 +0300 Subject: [PATCH] fix: skip disabled providers in combo fallback instead of returning 406 (#336) When a provider has credentials but all are disabled, return 404 (NOT_FOUND) instead of 400 (BAD_REQUEST). The combo handler already treats 404 as a fallbackable error, so it will skip to the next model in the chain. Previously, the 400 status caused the combo to stop with a hard error, killing the client (e.g., Claude Code) even though other models in the combo chain were available. Also changed log level from error to warn since disabled credentials are an expected configuration state, not an error. Fixes #334 --- src/sse/handlers/chat.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sse/handlers/chat.js b/src/sse/handlers/chat.js index 1ab2e91a..78da98b8 100644 --- a/src/sse/handlers/chat.js +++ b/src/sse/handlers/chat.js @@ -163,8 +163,8 @@ async function handleSingleModelChat(body, modelStr, clientRawRequest = null, re return unavailableResponse(status, `[${provider}/${model}] ${errorMsg}`, credentials.retryAfter, credentials.retryAfterHuman); } if (excludeConnectionIds.size === 0) { - log.error("AUTH", `No credentials for provider: ${provider}`); - return errorResponse(HTTP_STATUS.BAD_REQUEST, `No credentials for provider: ${provider}`); + log.warn("AUTH", `No active credentials for provider: ${provider}`); + return errorResponse(HTTP_STATUS.NOT_FOUND, `No active credentials for provider: ${provider}`); } log.warn("CHAT", "No more accounts available", { provider }); return errorResponse(lastStatus || HTTP_STATUS.SERVICE_UNAVAILABLE, lastError || "All accounts unavailable");