Repository navigation
fix(core): keep Claude Agent models from falling back to 200k context - #64107
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
I tested this change and it fixes the problem. I used the fake Claude Code setup (no real login here) with a version of the #61020 reproduction, on the base and on this PR.
- Saved models with no window, then a chat starts: on the base the model and the saved list stay at 200K. With this PR, the chat's report starts a full check, and the model and the saved list both get 1M.
- A stale server whose in-memory list has no window: on the base, a chat start erases the window another server saved. With this PR it is still erased at first, but the follow-up check writes it back.
- Your new test: it fails on the base and passes here. All Claude Agent tests pass,
plugin.test.tspasses 5 runs in a row, andtypecheck:tscinpackages/corepasses.
One case is still open, which I take to be intended: with no chat, startup still runs no check, so a saved list without windows shows 200K until the first chat in the process. Compaction only happens during chats, and the first chat starts the check, so in practice it should rarely matter.
Public API: unchanged. fromChat is an optional field on an internal status type.
No concerns that would block a merge.
Tarquinen
force-pushed
the
claude-agent-windows
branch
2 times, most recently
from
November 15, 2026 17:53
9e1ca39 to
3e60819
Compare
Tarquinen
force-pushed
the
claude-agent-windows
branch
from
November 15, 2026 17:56
3e60819 to
7ff9fb7
Compare
Tarquinen
enabled auto-merge (squash)
November 15, 2026 17:57
3 of 6 tasks
1 of 6 tasks
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.
Issue for this PR
Closes #61020
Type of change
What does this PR do?
Claude Agent only learns context windows from its full login check, which runs on connect or when no model list is saved. A chat's startup report has no windows, so when Claude Code adds or renames a model (for example Fable's id changing), the saved list keeps that model without a window and it falls back to the 200K default until the user reconnects.
Now a chat's report that includes a model with no known window starts one full check. Each model id is sent to a check at most once per process, so a model Claude Code can't measure doesn't keep re-triggering it. Full checks themselves never trigger another one.
How did you verify your code works?
devand passes with this change.--rerun-each 10, andbun typecheckpasses.Screenshots / recordings
Not a UI change.
Checklist