mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-23 07:32:20 +03:00
⭐5 — Provider x-search de primeira classe (SuperGrok/xAI x_search) em POST /v1/search e MCP omniroute_x_search. Fallback de credenciais xai-oauth→xao→xai; distinto de web search e do X Developer MCP. Reconciliado com o release tip (que já incluía #10981 "skip catalog-default SearXNG" deste mesmo lote): merge trouxe 5 conflitos reais de contagem gerada (llm.txt/README.md/AGENTS.md/PROVIDER_REFERENCE.md/SVGs/46 mirrors i18n, todos verificados como bump puro 347→348, sem perda de conteúdo do HEAD) + 1 conflito real de mergeable=CONFLICTING. Durante a validação, os 3 testes novos de SearXNG expuseram um bug real de interação com #10981: `isUnconfiguredLoopbackSearchProvider()` checava o baseUrl ESTÁTICO do catálogo em vez do baseUrl efetivo (após override de `provider_options.baseUrl` ou `providerSpecificData.baseUrl` da conexão), então QUALQUER request a searxng-search — mesmo com override customizado — era rejeitado como se fosse o default não-configurado. Corrigido em `open-sse/handlers/search.ts` (resolve o baseUrl efetivo via `resolveSearchBaseUrl()` antes do skip-check, tanto para o provider primário quanto o alternate). Um teste do próprio #10988 que assumia o comportamento pré-#10981 (default localhost:8888 sempre atendido) foi atualizado para refletir o comportamento já mesclado e intencional (503 quando não configurado). Validação completa: typecheck limpo, 70/70 testes unit (search-route/search-registry/x-search-provider/searxng-loopback-default), 24/24 vitest MCP, 14/14 integration (search-providers-catalog), lint limpo nos arquivos tocados, docs-counts-sync OK (2 drifts soft pré-existentes, não relacionados), gates estáticos (file-size/complexity/cognitive/dead-code/changelog) todos OK.
566 lines
18 KiB
TypeScript
566 lines
18 KiB
TypeScript
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
import fs from "node:fs";
|
|
import os from "node:os";
|
|
import path from "node:path";
|
|
|
|
const TEST_DATA_DIR = fs.mkdtempSync(path.join(os.tmpdir(), "omniroute-combo-metadata-"));
|
|
process.env.DATA_DIR = TEST_DATA_DIR;
|
|
process.env.API_KEY_SECRET ||= "combo-metadata-test-secret";
|
|
|
|
const core = await import("../../src/lib/db/core.ts");
|
|
const providersDb = await import("../../src/lib/db/providers.ts");
|
|
const combosDb = await import("../../src/lib/db/combos.ts");
|
|
const modelsDb = await import("../../src/lib/db/models.ts");
|
|
const contextOverrides = await import("../../src/lib/db/modelContextOverrides.ts");
|
|
const capabilityOverrides = await import("../../src/lib/db/modelCapabilityOverrides.ts");
|
|
const overrideRoute = await import("../../src/app/api/model-capability-overrides/route.ts");
|
|
const catalog = await import("../../src/app/api/v1/models/catalog.ts");
|
|
|
|
test.after(() => {
|
|
core.resetDbInstance();
|
|
fs.rmSync(TEST_DATA_DIR, { recursive: true, force: true });
|
|
});
|
|
|
|
test("single-target combo preserves its direct model metadata", async () => {
|
|
await providersDb.createProviderConnection({
|
|
provider: "codex",
|
|
authType: "oauth",
|
|
name: "codex-gpt-5.6-single-target-combo",
|
|
accessToken: "codex-test-token",
|
|
isActive: true,
|
|
testStatus: "active",
|
|
providerSpecificData: {},
|
|
});
|
|
await combosDb.createCombo({
|
|
name: "gpt-5.6-sol-combo",
|
|
strategy: "auto",
|
|
models: ["codex/gpt-5.6-sol"],
|
|
});
|
|
|
|
const response = await catalog.getUnifiedModelsResponse(
|
|
new Request("http://localhost/api/v1/models")
|
|
);
|
|
const body = (await response.json()) as { data: Array<Record<string, unknown>> };
|
|
const direct = body.data.find((item) => item.id === "cx/gpt-5.6-sol");
|
|
const combo = body.data.find((item) => item.id === "gpt-5.6-sol-combo");
|
|
|
|
assert.equal(response.status, 200);
|
|
assert.ok(direct);
|
|
assert.ok(combo);
|
|
for (const field of [
|
|
"context_length",
|
|
"max_input_tokens",
|
|
"max_output_tokens",
|
|
"input_modalities",
|
|
"output_modalities",
|
|
]) {
|
|
assert.deepEqual(combo[field], direct[field], field);
|
|
}
|
|
const comboCapabilities = combo.capabilities as Record<string, unknown>;
|
|
assert.equal(comboCapabilities.reasoning, true);
|
|
assert.equal(comboCapabilities.supportsThinking, true);
|
|
assert.equal(
|
|
Object.hasOwn(comboCapabilities, "effort_tiers"),
|
|
false,
|
|
"the combo must not infer adjustable tiers from the Codex model id"
|
|
);
|
|
});
|
|
|
|
test("single-target Codex combo advertises a larger model context override", async () => {
|
|
const modelId = "gpt-5.6-terra";
|
|
const contextWindow = 500000;
|
|
assert.equal(contextOverrides.setModelContextOverride("codex", modelId, contextWindow), true);
|
|
|
|
try {
|
|
await providersDb.createProviderConnection({
|
|
provider: "codex",
|
|
authType: "oauth",
|
|
name: "codex-gpt-5.6-context-override-combo",
|
|
accessToken: "codex-test-token",
|
|
isActive: true,
|
|
testStatus: "active",
|
|
providerSpecificData: {},
|
|
});
|
|
await combosDb.createCombo({
|
|
name: "gpt-5.6-context-override-combo",
|
|
strategy: "auto",
|
|
models: [`codex/${modelId}`],
|
|
});
|
|
|
|
const response = await catalog.getUnifiedModelsResponse(
|
|
new Request("http://localhost/api/v1/models")
|
|
);
|
|
const body = (await response.json()) as { data: Array<Record<string, unknown>> };
|
|
const direct = body.data.find((item) => item.id === `cx/${modelId}`);
|
|
const combo = body.data.find((item) => item.id === "gpt-5.6-context-override-combo");
|
|
|
|
assert.equal(response.status, 200);
|
|
assert.equal(direct?.context_length, contextWindow);
|
|
assert.equal(combo?.context_length, contextWindow);
|
|
assert.equal(combo?.max_input_tokens, 272000);
|
|
} finally {
|
|
contextOverrides.removeModelContextOverride("codex", modelId);
|
|
}
|
|
});
|
|
|
|
test("single-target combo respects registry reasoning overrides before specs", async () => {
|
|
await providersDb.createProviderConnection({
|
|
provider: "command-code",
|
|
authType: "apikey",
|
|
name: "command-code-gpt-5.4-mini-combo",
|
|
apiKey: "command-code-test-key",
|
|
isActive: true,
|
|
testStatus: "active",
|
|
providerSpecificData: {},
|
|
});
|
|
await combosDb.createCombo({
|
|
name: "gpt-5.4-mini-command-code-combo",
|
|
strategy: "auto",
|
|
models: ["command-code/gpt-5.4-mini"],
|
|
});
|
|
|
|
const response = await catalog.getUnifiedModelsResponse(
|
|
new Request("http://localhost/api/v1/models")
|
|
);
|
|
const body = (await response.json()) as { data: Array<Record<string, unknown>> };
|
|
const combo = body.data.find((item) => item.id === "gpt-5.4-mini-command-code-combo");
|
|
|
|
assert.equal(response.status, 200);
|
|
assert.ok(combo);
|
|
const capabilities = combo.capabilities as Record<string, unknown>;
|
|
assert.equal(typeof capabilities.reasoning, "boolean");
|
|
assert.equal(typeof capabilities.thinking, "boolean");
|
|
assert.equal(typeof capabilities.supportsThinking, "boolean");
|
|
});
|
|
|
|
test("reasoning_efforts overrides project exact native tiers to direct models and combo intersections", async () => {
|
|
const openaiTarget = "openai/gpt-4o";
|
|
const anthropicTarget = "anthropic/claude-sonnet-4-5";
|
|
assert.equal(
|
|
capabilityOverrides.setModelCapabilityOverride(
|
|
openaiTarget,
|
|
"reasoning_efforts",
|
|
"low,max,ultra"
|
|
),
|
|
true
|
|
);
|
|
assert.equal(
|
|
capabilityOverrides.setModelCapabilityOverride(
|
|
anthropicTarget,
|
|
"reasoning_efforts",
|
|
"medium,max,ultra"
|
|
),
|
|
true
|
|
);
|
|
|
|
try {
|
|
await providersDb.createProviderConnection({
|
|
provider: "openai",
|
|
authType: "apikey",
|
|
name: "reasoning-efforts-openai-combo",
|
|
apiKey: "openai-test-key",
|
|
isActive: true,
|
|
testStatus: "active",
|
|
});
|
|
await providersDb.createProviderConnection({
|
|
provider: "anthropic",
|
|
authType: "apikey",
|
|
name: "reasoning-efforts-anthropic-combo",
|
|
apiKey: "anthropic-test-key",
|
|
isActive: true,
|
|
testStatus: "active",
|
|
});
|
|
await combosDb.createCombo({
|
|
name: "reasoning-efforts-override-combo",
|
|
strategy: "auto",
|
|
models: [openaiTarget, anthropicTarget],
|
|
});
|
|
|
|
const response = await catalog.getUnifiedModelsResponse(
|
|
new Request("http://localhost/api/v1/models")
|
|
);
|
|
const body = (await response.json()) as { data: Array<Record<string, unknown>> };
|
|
const direct = body.data.find((item) => item.id === openaiTarget);
|
|
const combo = body.data.find((item) => item.id === "reasoning-efforts-override-combo");
|
|
|
|
assert.equal(response.status, 200);
|
|
assert.ok(direct);
|
|
assert.ok(combo);
|
|
assert.deepEqual((direct.capabilities as Record<string, unknown>).effort_tiers, [
|
|
"low",
|
|
"max",
|
|
"ultra",
|
|
]);
|
|
assert.deepEqual((combo.capabilities as Record<string, unknown>).effort_tiers, [
|
|
"max",
|
|
"ultra",
|
|
]);
|
|
} finally {
|
|
capabilityOverrides.removeModelCapabilityOverride(openaiTarget, "reasoning_efforts");
|
|
capabilityOverrides.removeModelCapabilityOverride(anthropicTarget, "reasoning_efforts");
|
|
}
|
|
});
|
|
|
|
test("compatible provider-node override reaches direct and combo metadata through its public prefix", async () => {
|
|
const nodeId = "openai-compatible-chat-reasoning-override";
|
|
const prefix = "reasoning-override";
|
|
const modelId = "native-reasoning-model";
|
|
await providersDb.createProviderNode({
|
|
id: nodeId,
|
|
type: "openai-compatible",
|
|
prefix,
|
|
name: "Reasoning Override",
|
|
apiType: "chat",
|
|
baseUrl: "https://example.com/v1",
|
|
});
|
|
const connection = await providersDb.createProviderConnection({
|
|
provider: nodeId,
|
|
authType: "api_key",
|
|
name: "reasoning-override-connection",
|
|
apiKey: "sk-test",
|
|
isActive: true,
|
|
testStatus: "active",
|
|
});
|
|
await modelsDb.replaceSyncedAvailableModelsForConnection(nodeId, connection.id, [
|
|
{ id: modelId, name: "Native Reasoning Model" },
|
|
]);
|
|
|
|
const patch = await overrideRoute.PATCH(
|
|
new Request("http://localhost/api/model-capability-overrides", {
|
|
method: "PATCH",
|
|
headers: { "content-type": "application/json" },
|
|
body: JSON.stringify({
|
|
target: `${prefix}/${modelId}`,
|
|
key: "reasoning_efforts",
|
|
value: "low,max,ultra",
|
|
}),
|
|
})
|
|
);
|
|
assert.equal(patch.status, 200);
|
|
assert.deepEqual(capabilityOverrides.getReasoningEffortsOverride(nodeId, modelId), [
|
|
"low",
|
|
"max",
|
|
"ultra",
|
|
]);
|
|
|
|
await combosDb.createCombo({
|
|
name: "provider-node-reasoning-override-combo",
|
|
strategy: "auto",
|
|
models: [`${prefix}/${modelId}`],
|
|
});
|
|
const response = await catalog.getUnifiedModelsResponse(
|
|
new Request("http://localhost/api/v1/models")
|
|
);
|
|
const body = (await response.json()) as { data: Array<Record<string, unknown>> };
|
|
const direct = body.data.find((item) => item.id === `${prefix}/${modelId}`);
|
|
const combo = body.data.find((item) => item.id === "provider-node-reasoning-override-combo");
|
|
|
|
assert.equal(response.status, 200);
|
|
assert.ok(direct);
|
|
assert.ok(combo);
|
|
for (const item of [direct, combo]) {
|
|
assert.deepEqual((item.capabilities as Record<string, unknown>).effort_tiers, [
|
|
"low",
|
|
"max",
|
|
"ultra",
|
|
]);
|
|
}
|
|
});
|
|
|
|
test("single-target combo reflects unblocked Antigravity Gemini reasoning", async () => {
|
|
await providersDb.createProviderConnection({
|
|
provider: "antigravity",
|
|
authType: "oauth",
|
|
name: "antigravity-gemini-reasoning-combo",
|
|
accessToken: "antigravity-test-token",
|
|
isActive: true,
|
|
testStatus: "active",
|
|
providerSpecificData: {},
|
|
});
|
|
await combosDb.createCombo({
|
|
name: "antigravity-gemini-reasoning-combo",
|
|
strategy: "auto",
|
|
models: ["antigravity/gemini-3.1-pro-high"],
|
|
});
|
|
|
|
const response = await catalog.getUnifiedModelsResponse(
|
|
new Request("http://localhost/api/v1/models")
|
|
);
|
|
const body = (await response.json()) as { data: Array<Record<string, unknown>> };
|
|
const combo = body.data.find((item) => item.id === "antigravity-gemini-reasoning-combo");
|
|
|
|
assert.equal(response.status, 200);
|
|
assert.ok(combo);
|
|
const capabilities = combo.capabilities as Record<string, unknown>;
|
|
assert.equal(capabilities.reasoning, true);
|
|
assert.equal(capabilities.thinking, true);
|
|
assert.equal(capabilities.supportsThinking, true);
|
|
assert.equal(
|
|
Object.hasOwn(capabilities, "effort_tiers"),
|
|
false,
|
|
"reasoning support alone must not synthesize adjustable tiers"
|
|
);
|
|
});
|
|
|
|
test("malformed connection catalog rows are marked for strict fail-closed consumers", async () => {
|
|
core
|
|
.getDbInstance()
|
|
.prepare("INSERT INTO key_value (namespace, key, value) VALUES (?, ?, ?)")
|
|
.run("syncedAvailableModels", "malformed-provider:malformed-connection", "{not-json");
|
|
|
|
const byConnection = await modelsDb.getSyncedAvailableModelsByConnection("malformed-provider");
|
|
assert.equal(byConnection[modelsDb.SYNCED_AVAILABLE_MODELS_MALFORMED], true);
|
|
assert.deepEqual(Object.keys(byConnection), []);
|
|
});
|
|
|
|
test("dynamic-account combo advertises only efforts shared by every selectable connection", async () => {
|
|
const first = await providersDb.createProviderConnection({
|
|
provider: "grok-cli",
|
|
authType: "oauth",
|
|
name: "grok-4.6-dynamic-first",
|
|
accessToken: "grok-first-token",
|
|
isActive: true,
|
|
testStatus: "active",
|
|
});
|
|
const second = await providersDb.createProviderConnection({
|
|
provider: "grok-cli",
|
|
authType: "oauth",
|
|
name: "grok-4.6-dynamic-second",
|
|
accessToken: "grok-second-token",
|
|
isActive: true,
|
|
testStatus: "active",
|
|
});
|
|
await modelsDb.replaceSyncedAvailableModelsForConnection("grok-cli", first.id, [
|
|
{
|
|
id: "grok-4.6",
|
|
name: "Grok 4.6",
|
|
supportedThinkingEfforts: ["low", "medium", "high"],
|
|
},
|
|
]);
|
|
await modelsDb.replaceSyncedAvailableModelsForConnection("grok-cli", second.id, [
|
|
{
|
|
id: "grok-4.6",
|
|
name: "Grok 4.6",
|
|
supportedThinkingEfforts: ["medium", "high"],
|
|
},
|
|
]);
|
|
await combosDb.createCombo({
|
|
name: "grok-dynamic-combo",
|
|
strategy: "auto",
|
|
models: ["grok-cli/grok-4.6"],
|
|
});
|
|
await combosDb.createCombo({
|
|
name: "grok-pinned-combo",
|
|
strategy: "auto",
|
|
models: [
|
|
{
|
|
kind: "model",
|
|
model: "grok-cli/grok-4.6",
|
|
connectionId: first.id,
|
|
},
|
|
],
|
|
});
|
|
await combosDb.createCombo({
|
|
name: "grok-allowlisted-combo",
|
|
strategy: "auto",
|
|
models: [
|
|
{
|
|
kind: "model",
|
|
model: "grok-cli/grok-4.6",
|
|
allowedConnectionIds: [second.id],
|
|
},
|
|
],
|
|
});
|
|
|
|
const response = await catalog.getUnifiedModelsResponse(
|
|
new Request("http://localhost/api/v1/models")
|
|
);
|
|
const body = (await response.json()) as { data: Array<Record<string, unknown>> };
|
|
const capabilitiesFor = (comboId: string) => {
|
|
const combo = body.data.find((item) => item.id === comboId);
|
|
assert.ok(combo, comboId);
|
|
return combo.capabilities as Record<string, unknown>;
|
|
};
|
|
|
|
assert.equal(response.status, 200);
|
|
assert.deepEqual(capabilitiesFor("grok-dynamic-combo").effort_tiers, ["medium", "high"]);
|
|
assert.deepEqual(capabilitiesFor("grok-pinned-combo").effort_tiers, ["low", "medium", "high"]);
|
|
assert.deepEqual(capabilitiesFor("grok-allowlisted-combo").effort_tiers, ["medium", "high"]);
|
|
|
|
const unknown = await providersDb.createProviderConnection({
|
|
provider: "grok-cli",
|
|
authType: "oauth",
|
|
name: "grok-4.6-unknown-efforts",
|
|
accessToken: "grok-unknown-token",
|
|
isActive: true,
|
|
testStatus: "active",
|
|
});
|
|
await modelsDb.replaceSyncedAvailableModelsForConnection("grok-cli", unknown.id, [
|
|
{ id: "grok-4.6", name: "Grok 4.6" },
|
|
]);
|
|
await combosDb.createCombo({
|
|
name: "grok-unknown-efforts-combo",
|
|
strategy: "auto",
|
|
models: [
|
|
{
|
|
kind: "model",
|
|
model: "grok-cli/grok-4.6",
|
|
allowedConnectionIds: [first.id, unknown.id],
|
|
},
|
|
],
|
|
});
|
|
|
|
const failClosedResponse = await catalog.getUnifiedModelsResponse(
|
|
new Request("http://localhost/api/v1/models")
|
|
);
|
|
const failClosedBody = (await failClosedResponse.json()) as {
|
|
data: Array<Record<string, unknown>>;
|
|
};
|
|
const failClosedCombo = failClosedBody.data.find(
|
|
(item) => item.id === "grok-unknown-efforts-combo"
|
|
);
|
|
assert.ok(failClosedCombo);
|
|
assert.equal(
|
|
Object.hasOwn(failClosedCombo.capabilities as Record<string, unknown>, "effort_tiers"),
|
|
false
|
|
);
|
|
});
|
|
|
|
test("provider-node combo intersects connection-scoped efforts behind its public prefix", async () => {
|
|
const nodeId = "openai-compatible-chat-connection-efforts";
|
|
const prefix = "scoped-efforts";
|
|
const modelId = "reasoning-model";
|
|
await providersDb.createProviderNode({
|
|
id: nodeId,
|
|
type: "openai-compatible",
|
|
prefix,
|
|
name: "Scoped Efforts",
|
|
apiType: "chat",
|
|
baseUrl: "https://example.com/v1",
|
|
});
|
|
const first = await providersDb.createProviderConnection({
|
|
provider: nodeId,
|
|
authType: "api_key",
|
|
name: "scoped-efforts-first",
|
|
apiKey: "sk-first",
|
|
isActive: true,
|
|
testStatus: "active",
|
|
});
|
|
const second = await providersDb.createProviderConnection({
|
|
provider: nodeId,
|
|
authType: "api_key",
|
|
name: "scoped-efforts-second",
|
|
apiKey: "sk-second",
|
|
isActive: true,
|
|
testStatus: "active",
|
|
});
|
|
await modelsDb.replaceSyncedAvailableModelsForConnection(nodeId, first.id, [
|
|
{ id: modelId, supportedThinkingEfforts: ["low", "high"] },
|
|
]);
|
|
await modelsDb.replaceSyncedAvailableModelsForConnection(nodeId, second.id, [
|
|
{ id: modelId, supportedThinkingEfforts: ["high"] },
|
|
]);
|
|
await combosDb.createCombo({
|
|
name: "provider-node-efforts-combo",
|
|
strategy: "auto",
|
|
models: [`${prefix}/${modelId}`],
|
|
});
|
|
|
|
const response = await catalog.getUnifiedModelsResponse(
|
|
new Request("http://localhost/api/v1/models")
|
|
);
|
|
const body = (await response.json()) as { data: Array<Record<string, unknown>> };
|
|
const combo = body.data.find((item) => item.id === "provider-node-efforts-combo");
|
|
|
|
assert.equal(response.status, 200);
|
|
assert.ok(combo);
|
|
assert.deepEqual((combo.capabilities as Record<string, unknown>).effort_tiers, ["high"]);
|
|
});
|
|
|
|
test("multi-target combo does not ignore a target with unknown reasoning metadata", async () => {
|
|
await providersDb
|
|
.createProviderConnection({
|
|
provider: "grok-cli",
|
|
authType: "oauth",
|
|
name: "known-target-mixed-combo",
|
|
accessToken: "grok-known-token",
|
|
isActive: true,
|
|
testStatus: "active",
|
|
})
|
|
.then((connection) =>
|
|
modelsDb.replaceSyncedAvailableModelsForConnection("grok-cli", connection.id, [
|
|
{
|
|
id: "grok-4.6",
|
|
supportedThinkingEfforts: ["low", "medium", "high"],
|
|
},
|
|
])
|
|
);
|
|
await providersDb.createProviderConnection({
|
|
provider: "github",
|
|
authType: "api_key",
|
|
name: "unknown-target-mixed-combo",
|
|
apiKey: "ghp-test",
|
|
isActive: true,
|
|
testStatus: "active",
|
|
});
|
|
await combosDb.createCombo({
|
|
name: "known-and-unknown-efforts-combo",
|
|
strategy: "auto",
|
|
models: ["grok-cli/grok-4.6", "github/catalog-unknown-model"],
|
|
});
|
|
|
|
const response = await catalog.getUnifiedModelsResponse(
|
|
new Request("http://localhost/api/v1/models")
|
|
);
|
|
const body = (await response.json()) as { data: Array<Record<string, unknown>> };
|
|
const combo = body.data.find((item) => item.id === "known-and-unknown-efforts-combo");
|
|
|
|
assert.equal(response.status, 200);
|
|
assert.ok(combo);
|
|
assert.equal(Object.hasOwn(combo.capabilities as Record<string, unknown>, "effort_tiers"), false);
|
|
});
|
|
|
|
test("mixed DeepSeek combos advertise the efforts accepted by every V4 target", async () => {
|
|
await providersDb.createProviderConnection({
|
|
provider: "deepseek",
|
|
authType: "apikey",
|
|
name: "deepseek-v4-combos",
|
|
apiKey: "deepseek-test-key",
|
|
isActive: true,
|
|
testStatus: "active",
|
|
});
|
|
await providersDb.createProviderConnection({
|
|
provider: "opencode-go",
|
|
authType: "apikey",
|
|
name: "opencode-go-deepseek-v4-combos",
|
|
apiKey: "opencode-go-test-key",
|
|
isActive: true,
|
|
testStatus: "active",
|
|
});
|
|
for (const modelId of ["deepseek-v4-flash", "deepseek-v4-pro"]) {
|
|
await combosDb.createCombo({
|
|
name: `${modelId}-combo`,
|
|
strategy: "auto",
|
|
models: [`deepseek/${modelId}`, `opencode-go/${modelId}`],
|
|
});
|
|
}
|
|
|
|
const response = await catalog.getUnifiedModelsResponse(
|
|
new Request("http://localhost/api/v1/models")
|
|
);
|
|
const body = (await response.json()) as { data: Array<Record<string, unknown>> };
|
|
|
|
assert.equal(response.status, 200);
|
|
for (const modelId of ["deepseek-v4-flash", "deepseek-v4-pro"]) {
|
|
const combo = body.data.find((item) => item.id === `${modelId}-combo`);
|
|
assert.ok(combo);
|
|
assert.deepEqual((combo.capabilities as Record<string, unknown>).effort_tiers, [
|
|
"none",
|
|
"low",
|
|
"high",
|
|
"max",
|
|
]);
|
|
}
|
|
});
|