Skip to content

docs(routing): LKGP sticks at provider level — align copy with routerStrategy contract - #11555

Merged
diegosouzapw merged 2 commits into
diegosouzapw:release/v3.8.51from
maxmad64bis:docs/lkgp-provider-stickiness
Aug 25, 2026
Merged

diegosouzapw merged 2 commits into
diegosouzapw:release/v3.8.51from
maxmad64bis:docs/lkgp-provider-stickiness

Conversation

@maxmad64bis

Copy link
Copy Markdown
Contributor

Summary

The lkgp routing strategy pins to the last known good provider and falls back to the rules strategy when that provider has no healthy candidate in the pool (open-sse/services/autoCombo/routerStrategy.ts). Two doc surfaces over-promised this contract:

  • README.md strategy table: "sticky to the last successful target"
  • docs/guides/USER_GUIDE.md: "sticks to the last successful model per session" and auto/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 to rules otherwise. 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 surrounding auto/* 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):

  • Change type: routing (docs-only accuracy fix)
  • Focused tests and category gates from the golden path — targeted run of tests/unit/router-strategies.test.ts: 24 pass, 0 fail; check-docs-sync.mjs, check-tracked-artifacts.mjs, check:any-budget:t11 all green
  • npm run lint — not runnable in my environment (local node_modules is incomplete); the touched .ts file and changelog fragment are prettier-clean, and CI runs lint on this PR
  • Reconciled with the current active release base (release/v3.8.51); focused checks rerun after the last rebase
  • Production-code changes include a new or updated automated test in this PR — N/A: no production code changed (tests only added under tests/)

Tests Added Or Updated

  • tests/unit/router-strategies.test.ts — 2 tests appended to the existing lkgp section:
    1. falls back to rules when the pool lacks the last known good provider — mono-provider pool whose only provider ≠ lastKnownGoodProvider; asserts the decision matches what getStrategy("rules").select() returns on the same inputs (expected derived from the real strategy, not duplicated).
    2. keeps the first candidate among several targets of the pinned provider — two CLOSED-breaker candidates of the pinned provider with distinct models/connections; asserts the first is kept with candidatesConsidered: 1.
  • No production code changed in this PR.

Reproduce: node --import tsx/esm --import ./open-sse/utils/setupPolyfill.ts --import ./tests/_setup/isolateDataDir.ts --test tests/unit/router-strategies.test.ts

Coverage Notes

No changes to src/, open-sse/, electron/, or bin/ — coverage is unaffected.

Reviewer Notes

  • The USER_GUIDE.md diff includes 9 re-padded table lines around the edited row, and the AUTO-COMBO.md row 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).
  • Changelog fragment uses placeholder number 0000 until the PR number exists; will be amended right after opening.

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
maxmad64bis force-pushed the docs/lkgp-provider-stickiness branch from b93890e to cefe155 Compare August 25, 2026 20:28
@diegosouzapw
diegosouzapw merged commit ffd8984 into diegosouzapw:release/v3.8.51 Aug 25, 2026
10 of 16 checks passed
@maxmad64bis
maxmad64bis deleted the docs/lkgp-provider-stickiness branch September 24, 2026 21:10
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants