diff --git a/open-sse/services/combo.ts b/open-sse/services/combo.ts index e8fdb613ef..43ee8c1b58 100644 --- a/open-sse/services/combo.ts +++ b/open-sse/services/combo.ts @@ -2065,7 +2065,6 @@ export async function handleComboChat({ { code: "ALL_ACCOUNTS_INACTIVE", type: "service_unavailable" } ); } - } const status = lastStatus; // Build aggregated error message with per-model failure details for diagnostics. diff --git a/tests/unit/repro-9630-combo-false-503.test.ts b/tests/unit/repro-9630-combo-false-503.test.ts index 53901640c3..16dd0ae3e0 100644 --- a/tests/unit/repro-9630-combo-false-503.test.ts +++ b/tests/unit/repro-9630-combo-false-503.test.ts @@ -1,10 +1,17 @@ import test from "node:test"; import assert from "node:assert/strict"; +import type { + ComboLogger, + ComboRelayOptions, +} from "../../open-sse/services/combo/types.ts"; import { handleComboChat, } from "../../open-sse/services/combo.ts"; import { getCircuitBreaker, STATE } from "../../src/shared/utils/circuitBreaker.js"; +const noopLogger: ComboLogger = { info: () => {}, warn: () => {}, debug: () => {}, error: () => {} }; +type BodyType = Record; + function okResponse() { return new Response(JSON.stringify({ ok: true }), { status: 200, @@ -27,14 +34,14 @@ test("#9630: combo returns 503 when circuit breaker is OPEN but other healthy ta strategy: "priority", models: ["openai/gpt-4", "anthropic/claude-opus-5"], }, - handleSingleModel: async (_body: any, modelStr: string) => { + handleSingleModel: async (_body: BodyType, modelStr: string) => { assert.equal(modelStr, "anthropic/claude-opus-5", "should skip openai breaker and try anthropic"); return okResponse(); }, isModelAvailable: async () => true, - log: { info: () => {}, warn: () => {}, debug: () => {}, error: () => {} } as any, + log: noopLogger, settings: null, - relayOptions: null as any, + relayOptions: null as unknown as ComboRelayOptions, allCombos: null, }); @@ -65,9 +72,9 @@ test("#9630: combo returns truthful error, not false ALL_ACCOUNTS_INACTIVE, when }, handleSingleModel: async () => { throw new Error("should not be called"); }, isModelAvailable: async () => true, - log: { info: () => {}, warn: () => {}, debug: () => {}, error: () => {} } as any, + log: noopLogger, settings: null, - relayOptions: null as any, + relayOptions: null as unknown as ComboRelayOptions, allCombos: null, });