Files
OmniRoute/tests/unit/model-listing-capability-5420.test.ts
backryun 00677044be [Part 3/3] feat(qwen): add regional Alibaba and Qwen Cloud providers (#7882)
* feat(qwen): add Qwen3.8 Max Preview catalogs [Part 2/3]

Rebuilt clean on release/v3.8.49 after Part 1 (#7866) squash-merged — applies
only the Part-2 delta (Qwen Web / Qoder qwen3.8-max-preview registration +
required-thinking allowlist + Qoder client rework) onto the current tip. No
migration in this part (that was Part 1).

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>

* feat(qwen): add regional Alibaba and Qwen Cloud providers [Part 3/3]

Rebuilt clean on top of Part 2 (#7874) over the current release tip — applies
only the Part-3 delta (alibaba Model Studio, Alibaba Token Plan, qwen-cloud,
qwen-cloud-token-plan with region selector). No migration in this part.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>

---------

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
2026-07-20 18:48:24 -03:00

39 lines
1.9 KiB
TypeScript

// #5420 — "Import Models" must be hidden for tool-only (search/fetch) providers,
// including ones whose id does NOT end in "-search" (e.g. firecrawl → webFetch),
// while staying visible for LLM and media providers that DO list models.
import { strict as assert } from "node:assert";
import { describe, it } from "node:test";
import {
providerLacksModelListing,
providerUsesCuratedModelsOnly,
} from "@/lib/providers/modelListingCapability";
describe("providerLacksModelListing (#5420)", () => {
it("hides model listing for -search suffixed providers regardless of kinds", () => {
assert.equal(providerLacksModelListing("brave-search", []), true);
assert.equal(providerLacksModelListing("brave-search", ["webSearch"]), true);
assert.equal(providerLacksModelListing("brave-search", ["llm"]), true);
});
it("hides model listing for tool-only providers without the -search suffix", () => {
assert.equal(providerLacksModelListing("firecrawl", ["webFetch"]), true);
assert.equal(providerLacksModelListing("x", ["webSearch"]), true);
assert.equal(providerLacksModelListing("y", ["webSearch", "webFetch"]), true);
});
it("keeps model listing for LLM and media providers", () => {
assert.equal(providerLacksModelListing("openai", []), false);
assert.equal(providerLacksModelListing("openai", ["llm"]), false);
assert.equal(providerLacksModelListing("falai", ["image"]), false);
assert.equal(providerLacksModelListing("x", ["webSearch", "llm"]), false);
assert.equal(providerLacksModelListing("z", ["embedding"]), false);
});
it("keeps Kimi Web visible while marking its model catalog as curated-only", () => {
assert.equal(providerLacksModelListing("kimi-web", ["llm"]), false);
assert.equal(providerUsesCuratedModelsOnly("kimi-web"), true);
assert.equal(providerUsesCuratedModelsOnly("qwen-cloud"), false);
assert.equal(providerUsesCuratedModelsOnly("kimi-coding"), false);
});
});