mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-27 01:22:10 +03:00
test(providers): update count-derived assertions for v3.8.51 additions (#11674)
Merged via /merge-batch (2026-08-26, v3.8.51). Boarded no worktree combinado; validação única: typecheck/complexity/cognitive-complexity/file-size/changelog verdes, lint nos mesmos 228 achados pré-existentes confirmados contra o tip puro, testes focados passando. Obrigado pela contribuição.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
- **test(providers):** update count-derived assertions after the v3.8.51 provider additions — `APIKEY_PROVIDERS` 233 → 235 (Opper #11629 + 1min.ai #11631), reserved-prefix REGISTRY walk 395 → 398, `WEB_FETCH_PROVIDERS` now includes `nimble-search` (#11620), and the provider translate-path golden snapshot regenerated ([#11449](https://github.com/diegosouzapw/OmniRoute/issues/11449)).
|
||||
@@ -1311,7 +1311,7 @@
|
||||
"Authorization": "Bearer <TOK>",
|
||||
"Content-Type": "application/json",
|
||||
"Openai-Beta": "responses=experimental",
|
||||
"User-Agent": "codex-cli/0.149.0 (<OS>; <ARCH>)",
|
||||
"User-Agent": "codex-cli/0.144.1 (<OS>; <ARCH>)",
|
||||
"Version": "0.149.0",
|
||||
"X-Codex-Beta-Features": "responses_websockets"
|
||||
},
|
||||
@@ -1319,7 +1319,7 @@
|
||||
"Authorization": "Bearer <TOK>",
|
||||
"Content-Type": "application/json",
|
||||
"Openai-Beta": "responses=experimental",
|
||||
"User-Agent": "codex-cli/0.149.0 (<OS>; <ARCH>)",
|
||||
"User-Agent": "codex-cli/0.144.1 (<OS>; <ARCH>)",
|
||||
"Version": "0.149.0",
|
||||
"X-Codex-Beta-Features": "responses_websockets"
|
||||
},
|
||||
@@ -1328,7 +1328,7 @@
|
||||
"Authorization": "Bearer <TOK>",
|
||||
"Content-Type": "application/json",
|
||||
"Openai-Beta": "responses=experimental",
|
||||
"User-Agent": "codex-cli/0.149.0 (<OS>; <ARCH>)",
|
||||
"User-Agent": "codex-cli/0.144.1 (<OS>; <ARCH>)",
|
||||
"Version": "0.149.0",
|
||||
"X-Codex-Beta-Features": "responses_websockets"
|
||||
}
|
||||
@@ -1950,8 +1950,8 @@
|
||||
}
|
||||
},
|
||||
"url": {
|
||||
"nonStream": "https://duckduckgo.com/duckchat/v1/chat",
|
||||
"stream": "https://duckduckgo.com/duckchat/v1/chat"
|
||||
"nonStream": "https://duck.ai/duckchat/v1/chat",
|
||||
"stream": "https://duck.ai/duckchat/v1/chat"
|
||||
}
|
||||
},
|
||||
"dxnt": {
|
||||
@@ -4396,6 +4396,29 @@
|
||||
"stream": "https://ollama.com/v1/chat/completions"
|
||||
}
|
||||
},
|
||||
"oneminai": {
|
||||
"format": "openai",
|
||||
"headers": {
|
||||
"apiKey": {
|
||||
"Accept": "text/event-stream",
|
||||
"Authorization": "Bearer <TOK>",
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
"nonStream": {
|
||||
"Authorization": "Bearer <TOK>",
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
"oauth": {
|
||||
"Accept": "text/event-stream",
|
||||
"Authorization": "Bearer <TOK>",
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
},
|
||||
"url": {
|
||||
"nonStream": "https://api.1min.ai/api/chat-with-ai",
|
||||
"stream": "https://api.1min.ai/api/chat-with-ai"
|
||||
}
|
||||
},
|
||||
"openadapter": {
|
||||
"format": "openai",
|
||||
"headers": {
|
||||
|
||||
@@ -91,7 +91,7 @@ test("web-fetch routing policies pin context7 as explicit-only and anonymous-cap
|
||||
// The generic providers stay mutable-free at the type level and complete.
|
||||
assert.deepEqual(
|
||||
[...WEB_FETCH_PROVIDERS],
|
||||
["firecrawl", "jina-reader", "tavily-search", "tinyfish", "context7"]
|
||||
["firecrawl", "jina-reader", "tavily-search", "tinyfish", "context7", "nimble-search"]
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -106,13 +106,13 @@ test("shared set excludes manual aliases that never intercept nodes at runtime",
|
||||
assert.equal(RESERVED_PROVIDER_PREFIXES.has("aq"), false);
|
||||
});
|
||||
|
||||
test("shared set size matches full REGISTRY scan (395 unique prefixes)", () => {
|
||||
// Count measured against release/v3.8.50 tip after this merge-batch boarded
|
||||
// #11333 (volcengine-coding-plan + volcengine-agent-plan, +4 ids/aliases) on
|
||||
// top of the 391 pinned post-upstream-65e81158a (was 329 at c68cda7df) —
|
||||
test("shared set size matches full REGISTRY scan (398 unique prefixes)", () => {
|
||||
// Count measured against release/v3.8.51 tip after #11629 (opper) and
|
||||
// #11631 (1min.ai) boarded — 398 unique ids/aliases walked from the
|
||||
// provider REGISTRY on top of the 395 pinned post-#11333.
|
||||
// the assertion pins that the set is a full REGISTRY walk, not a
|
||||
// hand-maintained list.
|
||||
assert.equal(RESERVED_PREFIX_COUNT, 395);
|
||||
assert.equal(RESERVED_PREFIX_COUNT, 398);
|
||||
});
|
||||
|
||||
test("isReservedProviderPrefix rejects non-string input", () => {
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
// The v3.8.50 back-merge (f95b03d) adds Synthetic (specialty-media) and
|
||||
// Kilo Gateway (gateways); #11434 adds volcengine-agent-plan and
|
||||
// volcengine-coding-plan (regional family) — both land at 233.
|
||||
// release/v3.8.51 adds Opper (gateways, #11629) and 1min.ai (gateways, #11631) — lands at 235.
|
||||
import { test } from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
|
||||
@@ -58,12 +59,12 @@ test("barrel still exports every catalog + key helpers", () => {
|
||||
}
|
||||
});
|
||||
|
||||
test("APIKEY_PROVIDERS merges the 6 family files into 233 entries (no loss / no dup)", async () => {
|
||||
test("APIKEY_PROVIDERS merges the 6 family files into 235 entries (no loss / no dup)", async () => {
|
||||
const keys = Object.keys((P as Record<string, object>).APIKEY_PROVIDERS);
|
||||
assert.equal(keys.length, 233);
|
||||
assert.equal(new Set(keys).size, 233, "duplicate keys after spread-merge");
|
||||
assert.equal(keys.length, 235);
|
||||
assert.equal(new Set(keys).size, 235, "duplicate keys after spread-merge");
|
||||
// the merged object's entry-count equals the sum of the 6 semantic family files; families are a
|
||||
// strict partition (every provider in exactly one), so the sum must be exactly 233.
|
||||
// strict partition (every provider in exactly one), so the sum must be exactly 235.
|
||||
const families: [string, string][] = [
|
||||
["gateways", "APIKEY_PROVIDERS_GATEWAYS"],
|
||||
["frontier-labs", "APIKEY_PROVIDERS_FRONTIER"],
|
||||
@@ -83,7 +84,7 @@ test("APIKEY_PROVIDERS merges the 6 family files into 233 entries (no loss / no
|
||||
seen.add(k);
|
||||
}
|
||||
}
|
||||
assert.equal(famTotal, 233, "families must partition all 233 providers");
|
||||
assert.equal(famTotal, 235, "families must partition all 235 providers");
|
||||
});
|
||||
|
||||
test("AI_PROVIDERS Proxy aggregates all sections; lookups resolve", () => {
|
||||
|
||||
Reference in New Issue
Block a user