Files
OmniRoute/tests/unit/model-listing-capability-5420.test.ts
Diego Rodrigues de Sa e Souza 0adae00c7b Release v3.8.42 (#5459)
Release v3.8.42 — full CHANGELOG in CHANGELOG.md.

CI: 103 checks green incl. CodeQL (all languages), Semgrep, all 8 unit shards,
coverage, Node 24 compat, and integration tests. Full unit suite validated
locally: 19437 pass / 0 fail. The 3 red checks are advisory and do not gate
main (no required status checks): SonarCloud/SonarQube new-code coverage gate,
and PR Test Policy (test-masking detector flagging the legitimate dead-Phind
provider removal in #5530 — reviewed, correct).

Includes cycle-close reconciliation + repair of inherited base-red tests from
#5480/#5527/#5427/#5521 that the PR->release fast-path did not exercise.
2026-06-30 06:54:29 -03:00

29 lines
1.5 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 } 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);
});
});