mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-13 18:32:12 +03:00
Landed with the design call resolved per the owner's pick — **option 1**: the synced store is now endpoint-agnostic (persistDiscoveredModels and managedModelImport no longer drop non-chat models at write time), and chat selectability moved to read time (auto-pool expansion in autoStrategy applies filterChatSelectableModels; the models-route projection already had its chatOnly filter). Your discovery test now passes end-to-end (3/3): /api/show capabilities persist per connection and image/embedding requests route through the advertising host. Reconciliation notes: conflicted areas merged onto the current tip (adobe discovery import, requestedModel preflight signature, resolvedProvider fast-path coexists with the synced-route override — explicit resolution wins); carried base-red drains (#10055 memoization, #11071 test variants) dropped as already-landed; the managed-model-import exclusion test was propagated to the new contract (image/video models persist; the read filter still hides them from chat pickers — pinned by a new assertion). Full battery: 205/206 focused (the one red is a confirmed periodic-timer timing flake on the loaded devbox — 20/20 isolated), autoCombo vitest 30/30, combo suites 46/46, gates + typecheck clean. Thank you @yourspraveen — the capability probe + routing design was right; it just needed the store contract opened up. Fixes #11087.
114 lines
3.8 KiB
TypeScript
114 lines
3.8 KiB
TypeScript
/**
|
|
* tests/integration/live-default-combo-workload.test.ts
|
|
*
|
|
* General breadth test against the REAL, currently-configured "default"
|
|
* combo on the target instance — unlike live-gemini-workload.test.ts (which
|
|
* provisions its own narrow 2-model Gemini-only combo), this targets every
|
|
* provider/model step the operator actually has in "default" directly,
|
|
* bypassing combo routing. One request per configured model: non-streaming
|
|
* + streaming Chat Completions, and streaming Responses API. Skips (never
|
|
* fails) any model whose provider connection isn't currently active, so one
|
|
* unrelated provider outage doesn't block the rest of the run.
|
|
*/
|
|
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
|
|
import {
|
|
skip,
|
|
getDefaultComboModelTargets,
|
|
filterActiveModelTargets,
|
|
sendModelRequest,
|
|
} from "./liveDefaultComboShared.ts";
|
|
|
|
let modelNames: string[] = [];
|
|
|
|
test.before(async () => {
|
|
if (skip) return;
|
|
const targets = await getDefaultComboModelTargets();
|
|
assert.ok(targets.length > 0, `"default" combo has no model steps — nothing to test`);
|
|
|
|
const { active, skipped } = await filterActiveModelTargets(targets);
|
|
if (skipped.length > 0) {
|
|
console.log(`\n [setup] skipping ${skipped.length} model(s) with inactive provider:`);
|
|
for (const s of skipped) console.log(` - ${s}`);
|
|
}
|
|
|
|
modelNames = active.map((t) => t.model);
|
|
console.log(`\n [setup] testing ${modelNames.length} model(s) from the live "default" combo`);
|
|
});
|
|
|
|
test(
|
|
"[32] default combo: non-streaming chat completions across every configured model",
|
|
{ skip },
|
|
async () => {
|
|
const failures: string[] = [];
|
|
for (const model of modelNames) {
|
|
const r = await sendModelRequest(model, false, "chat");
|
|
if (r.status !== 200 || r.contentLength === 0) {
|
|
failures.push(
|
|
`${model}: HTTP ${r.status}${r.error ? ` (${r.error})` : ""}, ${r.contentLength} chars`
|
|
);
|
|
}
|
|
}
|
|
if (failures.length > 0) {
|
|
console.log(`\n Non-streaming failures (${failures.length}/${modelNames.length}):`);
|
|
for (const f of failures) console.log(` ${f}`);
|
|
}
|
|
assert.equal(
|
|
failures.length,
|
|
0,
|
|
`${failures.length}/${modelNames.length} models failed non-streaming chat`
|
|
);
|
|
}
|
|
);
|
|
|
|
test(
|
|
"[33] default combo: streaming chat completions across every configured model",
|
|
{ skip },
|
|
async () => {
|
|
const failures: string[] = [];
|
|
for (const model of modelNames) {
|
|
const r = await sendModelRequest(model, true, "chat");
|
|
if (r.status !== 200 || r.contentLength === 0) {
|
|
failures.push(
|
|
`${model}: HTTP ${r.status}${r.error ? ` (${r.error})` : ""}, ${r.contentLength} chars`
|
|
);
|
|
}
|
|
}
|
|
if (failures.length > 0) {
|
|
console.log(`\n Streaming failures (${failures.length}/${modelNames.length}):`);
|
|
for (const f of failures) console.log(` ${f}`);
|
|
}
|
|
assert.equal(
|
|
failures.length,
|
|
0,
|
|
`${failures.length}/${modelNames.length} models failed streaming chat`
|
|
);
|
|
}
|
|
);
|
|
|
|
test(
|
|
"[34] default combo: streaming responses API across every configured model",
|
|
{ skip },
|
|
async () => {
|
|
const failures: string[] = [];
|
|
for (const model of modelNames) {
|
|
const r = await sendModelRequest(model, true, "responses");
|
|
if (r.status !== 200 || r.contentLength === 0) {
|
|
failures.push(
|
|
`${model}: HTTP ${r.status}${r.error ? ` (${r.error})` : ""}, ${r.contentLength} chars`
|
|
);
|
|
}
|
|
}
|
|
if (failures.length > 0) {
|
|
console.log(`\n Responses API failures (${failures.length}/${modelNames.length}):`);
|
|
for (const f of failures) console.log(` ${f}`);
|
|
}
|
|
assert.equal(
|
|
failures.length,
|
|
0,
|
|
`${failures.length}/${modelNames.length} models failed streaming Responses API`
|
|
);
|
|
}
|
|
);
|