fix(combo): fall through on pinned 401 responses (#12818)

* fix(combo): fall through on pinned 401 responses

* test(combo): cover pinned 401 in existing fallback regression

---------

Co-authored-by: Hermes Freebrain <freebrain@localhost>
This commit is contained in:
KeelTrace
2026-09-18 07:29:23 -07:00
committed by GitHub
parent 0e7925309d
commit 3e7764e57d
3 changed files with 3 additions and 2 deletions

View File

@@ -0,0 +1 @@
- **Combo routing:** a context-cache-pinned model that returns `401` now falls through to the normal combo fallback loop instead of terminating the request, allowing other eligible connections or providers to serve it.

View File

@@ -247,7 +247,7 @@ async function evaluatePinnedResponse(args: {
return null;
}
const pinnedStatus = pinnedResult.status || 500;
if (![408, 429, 500, 502, 503, 504].includes(pinnedStatus)) {
if (![401, 408, 429, 500, 502, 503, 504].includes(pinnedStatus)) {
return pinnedResult;
}
log.warn(

View File

@@ -491,7 +491,7 @@ test("tryPinnedModelDispatch: expands the combo system_message template on the p
});
test("tryPinnedModelDispatch: fails over when the pinned model returns a transient status", async () => {
for (const status of [408, 429, 500, 502, 503, 504]) {
for (const status of [401, 408, 429, 500, 502, 503, 504]) {
const ctx = pinCtx();
const { res } = await dispatchHealthyPin(
ctx,