From 484cb6e5629d9ba90f1ae03c7f9a17c8b53776a7 Mon Sep 17 00:00:00 2001 From: Diego Rodrigues de Sa e Souza Date: Fri, 21 Aug 2026 20:27:33 -0300 Subject: [PATCH] fix: add static model catalog for v0-vercel-web web-cookie provider (#10990) (#11066) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ⭐5 — Fix do dono com TDD. Estado committed+pushed limpo (hold-vivo cedido por instrução direta do operador). --- .../10990-v0-vercel-web-static-catalog.md | 1 + src/lib/providers/staticModels.ts | 9 +++++++ ...-10990-v0-vercel-web-static-models.test.ts | 25 +++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 changelog.d/fixes/10990-v0-vercel-web-static-catalog.md create mode 100644 tests/unit/repro-10990-v0-vercel-web-static-models.test.ts diff --git a/changelog.d/fixes/10990-v0-vercel-web-static-catalog.md b/changelog.d/fixes/10990-v0-vercel-web-static-catalog.md new file mode 100644 index 0000000000..9d56721208 --- /dev/null +++ b/changelog.d/fixes/10990-v0-vercel-web-static-catalog.md @@ -0,0 +1 @@ +- **Static model catalog for v0-vercel-web:** seed a static catalog for the v0-vercel-web web-cookie provider (v0-1.0-md, v0-1.5-lg, v0-1.5-md) so its dashboard "Available Models" / "Import from /models" UI serves a usable list instead of falling through to the route's 400 "does not support models listing" ([#10990](https://github.com/diegosouzapw/OmniRoute/issues/10990)). \ No newline at end of file diff --git a/src/lib/providers/staticModels.ts b/src/lib/providers/staticModels.ts index 06f4041776..a62c90b110 100644 --- a/src/lib/providers/staticModels.ts +++ b/src/lib/providers/staticModels.ts @@ -99,6 +99,15 @@ const STATIC_MODEL_PROVIDERS: Record Array<{ id: string; name: str { id: "google_scholar", name: "Google Scholar" }, { id: "duckduckgo", name: "DuckDuckGo" }, ], + "v0-vercel-web": () => [ + // v0-vercel-web web-cookie codegen provider — no upstream /v1/models endpoint, + // no registry `models` and no discovery config, so seed the current v0 lineup + // as a static catalog mirroring the v0-vercel API provider (shared.ts) so the + // model-import UI serves a list instead of the tail 400 (#10990). + { id: "v0-1.0-md", name: "V0 1.0 MD" }, + { id: "v0-1.5-lg", name: "V0 1.5 LG" }, + { id: "v0-1.5-md", name: "V0 1.5 MD" }, + ], "venice-web": () => [ // Venice.ai web-cookie provider — no upstream /v1/models endpoint, so seed the // current lineup as a static catalog (#6269). Venice rotates its catalog; keep diff --git a/tests/unit/repro-10990-v0-vercel-web-static-models.test.ts b/tests/unit/repro-10990-v0-vercel-web-static-models.test.ts new file mode 100644 index 0000000000..e8de722b90 --- /dev/null +++ b/tests/unit/repro-10990-v0-vercel-web-static-models.test.ts @@ -0,0 +1,25 @@ +/** + * #10990 — v0-vercel-web (a web-cookie codegen provider) shipped a web-cookie + * executor but no registry `models`, no discovery config, and no static-catalog + * entry, so its "Import from /models" fell through to the models route's tail 400 + * ("Provider v0-vercel-web does not support models listing"). Adding a + * `v0-vercel-web` entry to STATIC_MODEL_PROVIDERS gives the models route a local + * catalog to serve (same class as the #6269 venice-web / #7820 amazon-q fix). + * + * Kept as a standalone unit against the pure `getStaticModelsForProvider` resolver + * rather than extending the frozen `provider-models-route.test.ts` god-file. + */ +import test from "node:test"; +import assert from "node:assert/strict"; + +import { getStaticModelsForProvider } from "../../src/lib/providers/staticModels.ts"; + +test("#10990 v0-vercel-web resolves a non-empty static local catalog", () => { + const models = getStaticModelsForProvider("v0-vercel-web"); + assert.ok(models && models.length > 0, "v0-vercel-web should expose a static catalog"); + const ids = models.map((m) => m.id); + assert.ok( + ids.includes("v0-1.5-lg"), + `expected v0-1.5-lg in [${ids.join(", ")}]` + ); +}); \ No newline at end of file