mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-26 17:12:27 +03:00
docs(routing): LKGP sticks at provider level — align copy with routerStrategy contract (#11555)
Validated in a combined 4-PR batch worktree off release/v3.8.51 tip. Also removed a leftover changelog placeholder duplicate (0000-lkgp-doc-provider-stickiness.md, byte-identical content to the correctly-numbered 11555- fragment minus the PR link) — pushed to this branch. - Focused test: router-strategies.test.ts — part of batch's 60/60 node:test run - typecheck:core, file-size, changelog-integrity, complexity, cognitive-complexity, check:docs-counts-sync — all OK - Full-repo lint: 228 pre-existing dashboard react-hooks/* findings, unrelated to this diff Thanks for the docs-accuracy follow-through — aligning the LKGP copy with what routerStrategy.ts actually does (provider-level, not target/model) closes a real gap between prose and behavior.
This commit is contained in:
@@ -262,6 +262,34 @@ test("lkgp — lkgpEnabled:false delegates to rules", () => {
|
||||
assert.equal(d.strategy, "rules");
|
||||
});
|
||||
|
||||
test("lkgp — falls back to rules when the pool lacks the last known good provider", () => {
|
||||
const pool = [cand({ provider: "x" })];
|
||||
const context: RoutingContext = {
|
||||
taskType: "default",
|
||||
lastKnownGoodProvider: "y",
|
||||
};
|
||||
const d = getStrategy("lkgp").select(pool, context);
|
||||
const expected = getStrategy("rules").select(pool, context);
|
||||
assert.equal(d.strategy, expected.strategy);
|
||||
assert.equal(d.provider, expected.provider);
|
||||
assert.equal(d.model, expected.model);
|
||||
});
|
||||
|
||||
test("lkgp — keeps the first candidate among several targets of the pinned provider", () => {
|
||||
const pool = [
|
||||
cand({ provider: "shared", model: "shared/m1", connectionId: "conn-1" }),
|
||||
cand({ provider: "shared", model: "shared/m2", connectionId: "conn-2" }),
|
||||
];
|
||||
const d = getStrategy("lkgp").select(pool, {
|
||||
taskType: "default",
|
||||
lastKnownGoodProvider: "shared",
|
||||
});
|
||||
assert.equal(d.provider, "shared");
|
||||
assert.equal(d.model, "shared/m1");
|
||||
assert.equal(d.connectionId, "conn-1");
|
||||
assert.equal(d.candidatesConsidered, 1);
|
||||
});
|
||||
|
||||
// ── selectWithStrategy + registry ─────────────────────────────────────────────
|
||||
test("selectWithStrategy — dispatches by name", () => {
|
||||
const pool = [
|
||||
|
||||
Reference in New Issue
Block a user