fix: add static model catalog for v0-vercel-web web-cookie provider (#10990) (#11066)

5 — Fix do dono com TDD. Estado committed+pushed limpo (hold-vivo cedido por instrução direta do operador).
This commit is contained in:
Diego Rodrigues de Sa e Souza
2026-08-21 20:27:33 -03:00
committed by GitHub
parent 2ab16d3214
commit 484cb6e562
3 changed files with 35 additions and 0 deletions

View File

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

View File

@@ -99,6 +99,15 @@ const STATIC_MODEL_PROVIDERS: Record<string, () => 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

View File

@@ -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(", ")}]`
);
});