fix: repair stray brace in combo.ts and fix no-explicit-any types in repro-9630 test

This commit is contained in:
diegosouzapw
2026-08-07 15:03:52 -03:00
parent 9d8985880a
commit eddf330cbf
2 changed files with 12 additions and 6 deletions

View File

@@ -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.

View File

@@ -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<string, unknown>;
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,
});