-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix: enable 1M context window for Claude 3.5 Sonnet models #8418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Added support for claude-sonnet-4-5 (Claude 3.5 Sonnet) in Anthropic provider's 1M context check - Added Claude 3.5 Sonnet model IDs to BEDROCK_1M_CONTEXT_MODEL_IDS array - Added comprehensive tests for both Anthropic and Bedrock providers - Fixes issue where Claude 3.5 Sonnet showed 200K instead of 1M tokens when 1M context was enabled Fixes #8417
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Self-review: I argued with myself, lost, and now I agree with me.
| @@ -0,0 +1 @@ | |||
| Subproject commit 2c31616e8ade2a3995c3beda2d32d82fac17bf93 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P1: This appears to be an unintended submodule/temp artifact. Please remove tmp-pr-8415/Roo-Code from the PR to avoid introducing stray submodules/files.
| @@ -0,0 +1 @@ | |||
| Subproject commit 815444000508f67c41ba51175f1d3061364ea0bc | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P1: This looks like another unintended submodule/temp artifact. Please remove tmp/pr-8380-Roo-Code from the PR.
| if ( | ||
| provider === "anthropic" && | ||
| id === "claude-sonnet-4-20250514" && | ||
| (id === "claude-sonnet-4-20250514" || id === "claude-sonnet-4-5") && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3: Minor maintainability suggestion — model ID checks for 1M context (e.g., 'claude-sonnet-4-20250514' and 'claude-sonnet-4-5') could be centralized into a small set/constant to simplify future additions.
Description
This PR fixes an issue where Claude 3.5 Sonnet models were not displaying the correct 1M token context window in the UI when the "Enable 1M context window" option was enabled.
Problem
When using Claude 3.5 Sonnet (claude-sonnet-4-5) with the "Enable 1M context window" option enabled:
Solution
Changes
Testing
Screenshots
N/A - This is a backend logic fix that affects the displayed token count in the UI.
Fixes #8417
Important
Fixes UI to correctly display 1M context window for Claude 3.5 Sonnet models in Anthropic and Bedrock providers.
getSelectedModel()inuseSelectedModel.tsto handle 1M context for Claude 3.5 Sonnet in both Anthropic and Bedrock providers.BEDROCK_1M_CONTEXT_MODEL_IDSinbedrock.ts.getSelectedModel()to apply 1M context for Anthropic provider whenanthropicBeta1MContextis true.useSelectedModel.spec.tsto verify 1M context window behavior for both Anthropic and Bedrock providers.This description was created by
for 3b22cd0. You can customize this summary. It will automatically update as commits are pushed.