Skip to content

fix(routing): forward deps.settings.lkgpEnabled into RoutingContext (#11181) - #11202

Closed
yaman0786 wants to merge 2 commits into
diegosouzapw:release/v3.8.50from
yaman0786:fix/11181-lkgp-enabled-plumbing
Closed

yaman0786 wants to merge 2 commits into
diegosouzapw:release/v3.8.50from
yaman0786:fix/11181-lkgp-enabled-plumbing

Conversation

@yaman0786

@yaman0786 yaman0786 commented Aug 23, 2026 •

Copy link
Copy Markdown

Summary

Test plan

  • tests/unit/lkgp-enabled-plumbing-11181.test.ts
    • control: settings=null keeps pin
    • lkgpEnabled:false → rules picks cheap over pinned pricey; log has no LKGP: using last known good
  • combo-resolve-auto-strategy-split + combo-apply-strategy-ordering-split still pass
  • CI green on this branch

Reviewer notes

⚠️ base-red inherited: #9985

…#11181)

Settings → Routing LKGP toggle wrote/persisted but never reached the
router: resolveAutoStrategy and applyStrategyOrdering omitted
lkgpEnabled on context, so LKGPStrategyImpl's === false guard was dead
and pins could not be disabled.

Read getSettings().lkgpEnabled (default true) and pass it into
selectWithStrategy; skip LKGP reorder in applyStrategyOrdering when
false. Unit test covers both toggle states against a seeded pin.
…iegosouzapw#11181)

Settings → Routing LKGP toggle wrote/persisted but never reached the
router: resolveAutoStrategyOrder built a context literal that omitted
lkgpEnabled, so LKGPStrategyImpl's === false guard was dead code.

Forward the host-provided settings snapshot (chatCore → targetResolution)
into selectWithStrategy. No extra getSettings() round-trip; absent/null
keeps prior pin behavior. Explicit-combo applyStrategyOrdering path left
untouched (no settings dep today — separate scope).

Unit test drives the construction site with deps.settings + a real pin.
Changelog fragment for release aggregation.
@yaman0786 yaman0786 changed the title fix(sse): wire Settings lkgpEnabled into RoutingContext (#11181) fix(routing): forward deps.settings.lkgpEnabled into RoutingContext (#11181) Aug 23, 2026
@pacocartones

Copy link
Copy Markdown
Contributor

@yaman0786 heads up, I think we have independently written the same fix and one of us is going to waste effort. Flagging early rather than letting both sit in the queue.

Your #11202 and my #11193 both address #11181, both patch open-sse/services/combo/resolveAutoStrategy.ts, and both forward lkgpEnabled into the RoutingContext from the settings snapshot that is already loaded. Same file, same approach, same conclusion about the root cause.

For the record on timing, not as a claim of ownership: #11193 was opened at 2026-08-23T01:18:55Z and #11202 at 2026-08-23T02:56:12Z. Neither of us was assigned the issue, so this is just two people picking up the same unclaimed bug within a couple of hours. No bad faith anywhere.

I am not going to argue for mine over yours. @diegosouzapw, whichever is more useful, please take it and close the other — I genuinely do not mind which, and I would rather one merged fix than two competing ones.

One difference worth noting so the decision is informed. The changelog entries differ in a way that matters for traceability:

Looking at the existing entries in changelog.d/fixes/, the house convention appears to key on the issue number, so whichever PR is chosen may want the 11181- name.

@yaman0786 if yours is picked, I am happy to close mine immediately. Just say the word.

Separately, and unrelated to which of these wins: both are currently red, and neither is our fault. release/v3.8.50 is base-red for everyone right now (9 of 9 recent PRs by other authors fail the same checks). #11201 fixes part of it, and I have filed #11203 for a second breakage that #11201 does not yet cover.

@diegosouzapw

Copy link
Copy Markdown
Owner

Closing as superseded — this exact fix (forwarding lkgpEnabled into the RoutingContext literal in resolveAutoStrategyOrder) shipped today via #11193, including the same deliberate scope boundary (applyStrategyOrdering left untouched). Thank you @yaman0786 — your writeup confirmed the diagnosis independently!

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.

[BUG] Settings toggle lkgpEnabled never reaches RoutingContext, LKGP cannot be disabled

3 participants