Skip to content

Conversation

@mrubens
Copy link
Collaborator

@mrubens mrubens commented Sep 30, 2025

Important

Refactor Claude Sonnet 4 model handling to use BEDROCK_1M_CONTEXT_MODEL_IDS for 1M context window support.

  • Behavior:
    • Removed BEDROCK_CLAUDE_SONNET_4_MODEL_ID constant from bedrock.ts.
    • Updated AwsBedrockHandler in bedrock.ts to use BEDROCK_1M_CONTEXT_MODEL_IDS[0] for 1M context window logic.
    • Updated getSelectedModel() in useSelectedModel.ts to handle 1M context for Claude Sonnet 4 using BEDROCK_1M_CONTEXT_MODEL_IDS.
  • Tests:
    • Updated tests in bedrock.spec.ts to use BEDROCK_1M_CONTEXT_MODEL_IDS[0] instead of BEDROCK_CLAUDE_SONNET_4_MODEL_ID.
    • Updated tests in useSelectedModel.spec.ts to reflect changes in model ID handling for 1M context.

This description was created by Ellipsis for e056367. You can customize this summary. It will automatically update as commits are pushed.

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. lgtm This PR has been approved by a maintainer labels Sep 30, 2025
@mrubens mrubens merged commit 9af9d5b into main Sep 30, 2025
17 checks passed
@mrubens mrubens deleted the sonnet_4_5_cleanup branch September 30, 2025 18:28
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Sep 30, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Sep 30, 2025
Copy link
Contributor

@roomote roomote bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found some issues that need attention. See inline comments for details.

it("should enable 1M context window when awsBedrock1MContext is true for Claude Sonnet 4", () => {
const handler = new AwsBedrockHandler({
apiModelId: BEDROCK_CLAUDE_SONNET_4_MODEL_ID,
apiModelId: BEDROCK_1M_CONTEXT_MODEL_IDS[0],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Tests rely on BEDROCK_1M_CONTEXT_MODEL_IDS[0]. Suggest adding a test case for the 4.5 entry (index 1) or refactoring tests to avoid index assumptions so we won't regress if the array order changes.

const apiConfiguration: ProviderSettings = {
apiProvider: "bedrock",
apiModelId: BEDROCK_CLAUDE_SONNET_4_MODEL_ID,
apiModelId: BEDROCK_1M_CONTEXT_MODEL_IDS[0],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Similar to the Bedrock tests, this relies on BEDROCK_1M_CONTEXT_MODEL_IDS[0]. Consider adding a corresponding test for the 4.5 model or removing reliance on array order in tests.

if (
provider === "anthropic" &&
id === "claude-sonnet-4-20250514" &&
(id === "claude-sonnet-4-20250514" || id === "claude-sonnet-4-5") &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Robustness: selecting tiers?.[0] assumes the 1M tier is always first. Prefer selecting the highest-contextWindow tier to avoid order-dependence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants