Repository navigation
fix: recognize Claude Sonnet 5 as a 1M-context model - #50
Merged
Carl723000 merged 1 commit intoJul 1, 2026
Merged
Conversation
contextWindowFor() only matched the 1M window via a "4.6+" version pattern (e.g. sonnet-4-6), so claude-sonnet-5 - which has no "-4-" segment - fell through to the 200K legacy default. Add a check for bare major-version-5+ Sonnet models.
Collaborator
|
Thanks @UfukTanriverdi8 — clean fix, and nice touch citing the official model page. The major-version regex is the right call. Merging. |
Carl723000
approved these changes
Jul 1, 2026
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.
Summary
contextWindowFor()only recognized the 1M context window via a "4.6+"version pattern (e.g.
sonnet-4-6), soclaude-sonnet-5— whose model IDhas no
-4-segment — fell through to the legacy 200K default. This adds acheck for bare major-version-5+ Sonnet models, so the dashboard and
status-bar context bar correctly show a 1M window for Sonnet 5. Confirmed
against the official docs:
"Claude Sonnet 5 supports the 1M token context window by default (1M tokens
is both the default and the maximum; there is no smaller context variant)."
Linked issues
None.
Type of change
fix(patch)feature(minor)breaking(major)docs/ci/chore(patch)How was this tested?
src/test/dataLoader.test.tscoveringgetCurrentContextInfoforclaude-sonnet-5; confirmed it fails (200000) without the fix and passes(1000000) with it.
npm run compileclean;npm test— all 25 tests pass.(
claude-opus-4-8,claude-opus-4-1-20250805,claude-sonnet-4-5-20250929,claude-haiku-4-5-20251001, etc.) to confirm no regression to legacyclassification.
Checklist
npm run compileis cleanI18nwith all six languages filledCHANGELOG.mdupdated (user-visible changes)README.mdupdated if behaviour/settings changed — checked, noper-model context-window docs exist there to update
no new settings