diff --git a/changelog.d/fixes/0000-pinned-401-combo-fallback.md b/changelog.d/fixes/0000-pinned-401-combo-fallback.md new file mode 100644 index 0000000000..53fe353581 --- /dev/null +++ b/changelog.d/fixes/0000-pinned-401-combo-fallback.md @@ -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. diff --git a/open-sse/services/combo/dispatchPrelude.ts b/open-sse/services/combo/dispatchPrelude.ts index b39f592b51..a7d34caf93 100644 --- a/open-sse/services/combo/dispatchPrelude.ts +++ b/open-sse/services/combo/dispatchPrelude.ts @@ -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( diff --git a/tests/unit/combo-dispatch-prelude.test.ts b/tests/unit/combo-dispatch-prelude.test.ts index 68307b8da2..c4bf2afea3 100644 --- a/tests/unit/combo-dispatch-prelude.test.ts +++ b/tests/unit/combo-dispatch-prelude.test.ts @@ -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,