Repository navigation
docs(routing): LKGP sticks at provider level — align copy with routerStrategy contract - #11555
Merged
diegosouzapw merged 2 commits intoAug 25, 2026
Conversation
The strategy pins to the last known good PROVIDER and falls back to rules when that provider has no healthy candidate; README and USER_GUIDE promised per-target/per-model pinning. Pin the real contract with two contract-named tests covering the previously untested mono-provider path.
maxmad64bis
force-pushed
the
docs/lkgp-provider-stickiness
branch
from
August 25, 2026 20:28
b93890e to
cefe155
Compare
diegosouzapw
merged commit Aug 25, 2026
ffd8984
into
diegosouzapw:release/v3.8.51
10 of 16 checks passed
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…Strategy contract (diegosouzapw#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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
lkgprouting strategy pins to the last known good provider and falls back to therulesstrategy when that provider has no healthy candidate in the pool (open-sse/services/autoCombo/routerStrategy.ts). Two doc surfaces over-promised this contract:README.mdstrategy table: "sticky to the last successful target"docs/guides/USER_GUIDE.md: "sticks to the last successful model per session" andauto/lkgp: "sticky to the most recently successful target"docs/routing/AUTO-COMBO.md: "Last-Known-Good Path (sticky route to last successful target)"The strategy has never operated at target or model granularity — it filters candidates on
c.provider === lastKnownGoodProvider, takes the first non-OPEN one, and delegates torulesotherwise. This PR replaces all three lines with a single accurate phrasing: pins to the last successful provider, then falls back to rules. The widened table cell also required re-padding the surroundingauto/*variant table (formatting only).Translated docs (
docs/i18n/**) are intentionally untouched so the maintainer's translation pipeline can pick the corrected source up.Related Issues
None — follow-up to my earlier docs-accuracy PRs (#11543, #11545) on the same theme: prose drifting from what ships.
Validation
Change type: routing (docs accuracy for a routing strategy; no behavior change).
The full unit suite, Vitest, the 60% coverage gate, and the production build all run in CI on this PR (#8329):
tests/unit/router-strategies.test.ts: 24 pass, 0 fail;check-docs-sync.mjs,check-tracked-artifacts.mjs,check:any-budget:t11all greennpm run lint— not runnable in my environment (localnode_modulesis incomplete); the touched.tsfile and changelog fragment are prettier-clean, and CI runs lint on this PRrelease/v3.8.51); focused checks rerun after the last rebasetests/)Tests Added Or Updated
tests/unit/router-strategies.test.ts— 2 tests appended to the existinglkgpsection:lastKnownGoodProvider; asserts the decision matches whatgetStrategy("rules").select()returns on the same inputs (expected derived from the real strategy, not duplicated).candidatesConsidered: 1.Reproduce:
node --import tsx/esm --import ./open-sse/utils/setupPolyfill.ts --import ./tests/_setup/isolateDataDir.ts --test tests/unit/router-strategies.test.tsCoverage Notes
No changes to
src/,open-sse/,electron/, orbin/— coverage is unaffected.Reviewer Notes
USER_GUIDE.mddiff includes 9 re-padded table lines around the edited row, and theAUTO-COMBO.mdrow is padded to its table's canonical prettier width — pure formatting, computed per-table (these doc files are not prettier-clean as whole files, so a full-file run was deliberately avoided).0000until the PR number exists; will be amended right after opening.