Repository navigation
fix(desktop): keep user-pinned model limits across provider enrichment - #1299
Merged
Merged
Conversation
The Pi 0.99.1 migration replaced the source-aware limit resolution in enrichProvider's binding mapping with the raw catalog number, so a user who pinned a 1M context window on a relay model saw the published 128k value overwrite it on every read (issue vastsa#1176, spec §9.1: a user limit is never replaced). resolveBindingLimits + modelConfigWithBinding are restored for the mapping, while catalog-sourced windows keep following published corrections.
Resolve catalog and user token limits through the provenance helper while keeping model capability shaping out of provider enrichment. This retains hand-typed model overrides and the existing enrichment boundary.
This branch was previously deployed
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.
Fixes #1176.
Problem
The Pi 0.99.1 migration (
b72ff6759) replaced the source-aware limit resolution inenrichProvider's binding mapping with the rawcatalogModelConfigForvalue. A user who pinned a 1M context window on a relay model then saw the catalog's 128k overwrite it on every read — the report in #1176: same key, context window dropped from 1M to 128k between versions. This also contradicts the rulemodelConfigForitself documents (spec §9.1: a user limit is never replaced; a user pin on a relay hit must not be silently replaced by the published number).Fix
enrichProvider's binding mapping resolves limits throughresolveBindingLimits+modelConfigWithBindingagain, so:user-pinned context window/output cap survives enrichment (the [Bug] #1176 case)catalog-sourced window keeps following published correctionsuserdefault)Validation
node --test apps/desktop/test/provider-catalog-runtime.test.mjs(Node 22.23.2): 8/8 pass, including a new regression test covering a user pin on a catalog hit, a user pin on an unmatched hand-typed id, and a catalog-sourced window still following the published numbertsc --noEmiton apps/desktop: no errors in the touched file (pre-existing unrelated errors elsewhere, unchanged by this diff)origin/main(merge-base --is-ancestorok)