mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-18 12:52:25 +03:00
Merged as part of the 39-PR owner batch of 2026-09-11, validated as a unit. Boarded into one consolidated worktree cut from `release/v3.8.51` with the other 38 — zero conflicts between them. - ESLint over every changed file: no errors (the only finding was one suppression entry the batch emptied, pruned on #13243) - `typecheck:core` clean; `check:dashboard-typecheck` OK (206 pre-existing, within baseline); `check:changelog-integrity` OK - complexity 2821 / baseline 3218 and cognitive-complexity 1272 / baseline 1437 — both under baseline - 256 assertions green: 246 under node:test and 10 under vitest, which is where `tests/unit/**/*.test.tsx` actually runs - `check-file-size`: `chatCore.ts` rebaselined 6144 → 6146 for #13278 and #13276, annotated and landed on #13243 ⚠️ base-red inherited: #12732 — the provider count (356 in the docs vs the 358 the modules define) and `open-sse/utils/stream.ts` at 3115 > frozen 3098 both reproduce on the pure tip with zero contribution from this batch.
34 lines
1.7 KiB
TypeScript
34 lines
1.7 KiB
TypeScript
import { test } from "node:test";
|
|
import assert from "node:assert/strict";
|
|
import { REGISTRY } from "../../open-sse/config/providerRegistry.ts";
|
|
import { getTokenLimit } from "../../open-sse/services/contextManager.ts";
|
|
|
|
test("#12681: opencode registry declares an explicit real contextLength for muse-spark-1.2 models", () => {
|
|
const opencode = REGISTRY["opencode"];
|
|
const museSpark = opencode.models.find((m) => m.id === "muse-spark-1.2");
|
|
const museSparkFree = opencode.models.find((m) => m.id === "muse-spark-1.2-contributor-free");
|
|
assert.notEqual(
|
|
museSpark?.contextLength,
|
|
undefined,
|
|
"muse-spark-1.2 should declare its own real contextLength instead of relying on the 200000 provider default"
|
|
);
|
|
assert.notEqual(
|
|
museSparkFree?.contextLength,
|
|
undefined,
|
|
"muse-spark-1.2-contributor-free should declare its own real contextLength instead of relying on the 200000 provider default"
|
|
);
|
|
});
|
|
|
|
test("#12681: opencode-zen registry declares an explicit real contextLength for muse-spark-1.2 models", () => {
|
|
const zen = REGISTRY["opencode-zen"];
|
|
const museSpark = zen.models.find((m) => m.id === "muse-spark-1.2");
|
|
const museSparkFree = zen.models.find((m) => m.id === "muse-spark-1.2-contributor-free");
|
|
assert.notEqual(museSpark?.contextLength, undefined);
|
|
assert.notEqual(museSparkFree?.contextLength, undefined);
|
|
});
|
|
|
|
test("#12681: contextManager.getTokenLimit resolves muse-spark-1.2-contributor-free to its real 1M+ window, not the 200000 provider default", () => {
|
|
assert.equal(getTokenLimit("opencode", "muse-spark-1.2-contributor-free"), 1048576);
|
|
assert.equal(getTokenLimit("opencode-zen", "muse-spark-1.2-contributor-free"), 1048576);
|
|
});
|