mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-26 17:12:27 +03:00
Merged — locally validated (72/72 focused tests, typecheck:core clean, all static gates green) after resolving base-drift conflicts (catalog.ts cooperative-yield insertion point, modelMetadataRegistry.ts snapshot-param signature). CI's red checks (Unit Tests fast-path shards, Fast Quality Gates, Docs Gates) are confirmed PRE-EXISTING base-red on the pure release tip — reproduced tests/unit/db-driver-bundling-externals.test.ts, tests/unit/model-catalog-runtime-invalidation.test.ts and others failing identically against origin/release/v3.8.50 with zero PR content, unrelated to this change. Thanks for the design and for absorbing #10724's value here — great work on both review rounds!
42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
import test from "node:test";
|
||
import assert from "node:assert/strict";
|
||
|
||
const { parseReasoningEffortsOverride } =
|
||
await import("../../src/shared/reasoning/reasoningEffortsOverride.ts");
|
||
|
||
test("parses native reasoning efforts using only ASCII commas", () => {
|
||
assert.deepEqual(parseReasoningEffortsOverride("none, low,medium, high, xhigh,max,ultra"), {
|
||
ok: true,
|
||
efforts: ["none", "low", "medium", "high", "xhigh", "max", "ultra"],
|
||
});
|
||
});
|
||
|
||
test("strips whitespace, CR/LF, NBSP, BOM, and zero-width edge characters", () => {
|
||
assert.deepEqual(
|
||
parseReasoningEffortsOverride(" low\r\n, max , ultra"),
|
||
{ ok: true, efforts: ["low", "max", "ultra"] }
|
||
);
|
||
});
|
||
|
||
test("rejects empty, duplicate, unknown, and non-ASCII-comma input", () => {
|
||
for (const input of [
|
||
"",
|
||
"low,",
|
||
",low",
|
||
"low,,high",
|
||
"low, low",
|
||
"LOW, low",
|
||
"minimal,low",
|
||
"low,unknown",
|
||
"low,high",
|
||
"low、high",
|
||
]) {
|
||
const parsed = parseReasoningEffortsOverride(input);
|
||
assert.equal(parsed.ok, false, input);
|
||
}
|
||
});
|
||
|
||
test("does not strip invisible characters from the middle of an effort", () => {
|
||
assert.equal(parseReasoningEffortsOverride("low,high").ok, false);
|
||
});
|