Files
OmniRoute/tests/unit/lib/volcengine-plan-model-discovery.test.ts
Markus Hartung 04dba0460e fix(responses-continuation): recover a real id/output for passthrough and translate-mode replies (#11434)
Retargetado para release/v3.8.51 (release/v3.8.50 está congelada — freeze issue #11439). Validado em lote combinado (batch-0824h2, junto de #11435/#11436/#11437) contra o tip de release/v3.8.51: typecheck:core limpo, gates estáticos OK, 127/127 testes focados passando.

Investigação sólida com repro real via container isolado, três causas independentes identificadas e corrigidas com testes de regressão dedicados para cada uma. Obrigado pela contribuição!
2026-08-24 19:57:12 -03:00

70 lines
2.2 KiB
TypeScript

import assert from "node:assert/strict";
import test from "node:test";
import { enrichModel, parseLatestModelList } from "@/lib/providers/volcenginePlanModelDiscovery";
test("Agent Plan discovery keeps all ListAgentPlanLatestModel entries", () => {
// `ListAgentPlanLatestModel` returns the same shape as Coding Plan's
// `ListArkCodeLatestModel`: ModelId / OutputName / Enabled / Description.
// We keep ALL entries — `Enabled` only reflects console visibility, not
// API availability. Previously disabled-but-callable models like
// kimi-k3 must be retained.
const models = parseLatestModelList({
Result: {
Data: [
{
ModelId: "doubao-seed-evolving-latest-version",
OutputName: "doubao-seed-evolving",
Enabled: false,
EnabledThinking: true,
},
{
ModelId: "kimi-k3-260701",
OutputName: "kimi-k3",
Enabled: false,
EnabledThinking: true,
},
{
ModelId: "auto",
OutputName: "auto",
Enabled: true,
},
{
ModelId: "minimax-m3-modelhub",
OutputName: "minimax-m3",
Enabled: false,
EnabledThinking: true,
},
],
},
});
assert.deepEqual(
models.map((model) => model.id),
["doubao-seed-evolving-latest-version", "kimi-k3-260701", "auto", "minimax-m3-modelhub"]
);
// OutputName is used as the canonical family name for enrichment.
assert.equal(models[1].name, "kimi-k3");
assert.equal(models[1].enabledThinking, true);
});
test("enrichment maps context/vision/tools from the OutputName family", () => {
const kimi = enrichModel({ id: "kimi-k3-260701", name: "kimi-k3" });
assert.equal(kimi.inputTokenLimit, 1048576);
assert.equal(kimi.supportsVision, true);
assert.equal(kimi.supportsTools, true);
assert.equal(kimi.supportsThinking, true);
const glm = enrichModel({ id: "glm-5-3-260801", name: "glm-5.3" });
assert.equal(glm.inputTokenLimit, 1048576);
assert.equal(glm.supportsVision, false);
const doubao = enrichModel({
id: "doubao-seed-evolving-latest-version",
name: "doubao-seed-evolving",
});
assert.equal(doubao.inputTokenLimit, 1048576);
assert.equal(doubao.supportsVision, true);
});