models: keep a learned window on seed rows without losing the [1m] variant (split from #9513)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 53/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript
- Domain
- ai-infra-agents, backend
Research direction
Start with packages/server/src/models.js and trace createModelsRegistry().updateModels, the [1m] synthesis loop, and the contextWindowOverrides cache; then read sdk-session.js around updateContextWindow. Add tests for a learned 123,456 window surviving refresh, a 200,000 learned base retaining its [1m] variant, and an unchanged seed window when no learned value exists. Check whether the live-row case also loses the variant; done when all cases pass.
Written by the indexing model from the issue text.
Description
Context
Split from #9513 item 2, during the review of #9517 at ef0c2789a.
#9513 item 2 asked the static-seed union in createModelsRegistry().updateModels (packages/server/src/models.js) to prefer contextWindowOverrides.get(fullId). That way an in-use seed row would keep its learned context window across a refresh, instead of snapping back to the seed value until the session's next turn.
The round 1 review of #9517 found that this interacts with the [1m] synthesis gate. #9517 therefore ships without it.
The interaction
updateContextWindowlearns a model's window from the SDK'sresult.modelUsage[<model>].contextWindow(sdk-session.js, about line 1735).- For a base Claude model that window is the base tier. The repo's own fixtures report
claude-sonnet-4-6: { contextWindow: 200000 }, and the pricing table describes base rates as the ≤200K tier. [1m]variants are synthesized only for a base row whosecontextWindow >= 1_000_000(models.js, the synthesis loop).- If the seed union prefers the learned base window, a turn on the base model (for example
claude-sonnet-5-5, the new-session default) can set it to 200,000. The next refresh then stops synthesizingclaude-sonnet-5-5[1m], and the "1M" choice leaves the picker unless a session is using it. - Today the refresh resets the seed row to its seed window (1,000,000), so the choice stays.
- The reviewer reproduced the mechanism with a probe, a base learned below 1M then a refresh, which loses the variant. Whether the live SDK reports a sub-1M window for a 5.x base model is not verified.
What a fix needs
- Gate
[1m]synthesis on the model's long-context capability: the declared or seed window, or provider metadata. Do not gate it on the base row's learned window, which can truthfully be the 200K tier while[1m]is available. - Only then let the seed union prefer the learned window (the original #9513 item 2). Pin both with tests:
- a seed row that learned 123,456 keeps it after a refresh, and the cache holds it;
- a base seed row that learned 200,000 still yields its
[1m]variant after a refresh; - a seed row with no learned window keeps the seed value.
- Live rows already prefer the override first (
convertedmap). Check whether a live base row learned below 1M loses its[1m]chip at a refresh today. If it does, the same gate fixes it.
Impact today
Low. The context meter reads the per-session occupancy snapshot first. A reset seed window heals on the session's next turn. Only the picker's displayed window and the meter's fallback are affected.
- Dominant language
- JavaScript
- Stars
- 7
- Forks
- 1
- Avg merge
- 2h 3m
- Merged PRs (30d)
- 333
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from blamechris/chroxy
-
from-review tech-debt testing
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
blamechris/chroxy#9520 ·
Maintainers usually reply within 1 day
-
priority: low server
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
blamechris/chroxy#9340 ·
Maintainers usually reply within 1 day
-
documentation from-review
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
blamechris/chroxy#9237 ·
Maintainers usually reply within 1 day
-
agent-control client: notify() docstring should say the outbound gate applies only in principal modeOpenenhancement from-review
Difficulty 1/5 Under an hour Newbie friendliness 80/100
blamechris/chroxy#9227 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
blamechris/chroxy#9108 ·
Maintainers usually reply within 1 day
All issues in blamechris/chroxy
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Use one constant for the 10,000-character input limitPossibly taken @NginxL claimed this today. Opengood first issue refactor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
aniru-dh21/snap-validate#51 ·
Maintainers usually reply within 1 day
-
Documentation pleaseOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
area/host bug P2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Fei2411/DeepSeek-Bot#3190 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
freelawproject/litigant-portal#1307 ·
Maintainers usually reply within 2 days