fix: update AWS Bedrock Anthropic model specs to latest official documentation#12056
fix: update AWS Bedrock Anthropic model specs to latest official documentation#12056nangsontay wants to merge 1 commit intoRooCodeInc:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates AWS Bedrock Anthropic model metadata so the app’s model selection, token limits, and pricing calculations align with the latest Bedrock model-card documentation.
Changes:
- Increased
maxTokensfor Claude Sonnet 4 / Opus 4 family entries to 64,000. - Marked Claude Sonnet 4.6 and Opus 4.6 as having a native 1M context window (removed 1M beta/tier behavior in type definitions and updated test expectations).
- Adjusted Bedrock provider heuristics for Claude 4 in
guessModelInfoFromId.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/types/src/providers/bedrock.ts | Updates Bedrock Anthropic model definitions (token limits, 1M context handling, tiers). |
| src/api/providers/bedrock.ts | Updates heuristic defaults for Claude 4 model IDs when a model isn’t in the static table. |
| src/api/providers/tests/bedrock.spec.ts | Updates expectations for Claude Sonnet 4.6 native 1M context behavior and pricing. |
Comments suppressed due to low confidence (4)
src/api/providers/bedrock.ts:299
guessModelInfoFromIdpatterns for Claude 4 won’t match the AWS Bedrock Anthropic model IDs used elsewhere in this repo (e.g.anthropic.claude-sonnet-4-20250514-v1:0containsclaude-sonnet-4, notclaude-4). As a result, unknown Claude 4 Sonnet IDs will fall back to the default model info rather than a Claude 4-specific guess. Consider matchingclaude-sonnet-4(and/or using a regex forclaude-.*-4) in addition toclaude-4.
// Define a mapping for model ID patterns and their configurations
const modelConfigMap: Record<string, Partial<ModelInfo>> = {
"claude-4": {
maxTokens: 64_000,
contextWindow: 200_000,
supportsImages: true,
supportsPromptCache: true,
},
"claude-3-7": {
src/api/providers/bedrock.ts:316
- The Claude 4 Opus heuristic key
claude-4-opusdoesn’t match AWS Bedrock Anthropic Opus IDs (they areclaude-opus-4-..., e.g.anthropic.claude-opus-4-20250514-v1:0). This makes the heuristic ineffective for unknown Opus 4 IDs and can cause incorrect pricing/capability defaults. Consider also matchingclaude-opus-4(andclaude-opus-4-6if maxTokens differs).
"claude-4-opus": {
maxTokens: 64_000,
contextWindow: 200_000,
supportsImages: true,
supportsPromptCache: true,
},
packages/types/src/providers/bedrock.ts:39
- In this model entry the pricing comments still refer to “≤200K context”, but
contextWindowis now set to a native 1,000,000. This is confusing/misleading documentation—either update the comments to reflect native 1M pricing semantics or remove the context qualifier.
maxTokens: 64_000,
contextWindow: 1_000_000, // Native 1M context window
supportsImages: true,
supportsPromptCache: true,
supportsReasoningBudget: true,
inputPrice: 3.0, // $3 per million input tokens (≤200K context)
outputPrice: 15.0, // $15 per million output tokens (≤200K context)
cacheWritesPrice: 3.75, // $3.75 per million tokens
cacheReadsPrice: 0.3, // $0.30 per million tokens
packages/types/src/providers/bedrock.ts:145
- This Opus 4.6 entry sets
contextWindowto native 1,000,000, but the pricing comments still say “≤200K context”. Please update/remove those qualifiers so the entry is self-consistent.
maxTokens: 128_000,
contextWindow: 1_000_000, // Native 1M context window
supportsImages: true,
supportsPromptCache: true,
supportsReasoningBudget: true,
inputPrice: 5.0, // $5 per million input tokens (≤200K context)
outputPrice: 25.0, // $25 per million output tokens (≤200K context)
cacheWritesPrice: 6.25, // $6.25 per million tokens
cacheReadsPrice: 0.5, // $0.50 per million tokens
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| }) | ||
|
|
||
| it("should apply 1M tier pricing when awsBedrock1MContext is true for Claude Sonnet 4.6", () => { | ||
| it("should have native 1M context window for Claude Sonnet 4.6 without needing beta flag", () => { |
There was a problem hiding this comment.
PR description still contains the placeholder Closes: # <!-- Replace with the issue number --> instead of an actual linked issue number. Please update the PR description to reference the approved issue so it can be tracked/auto-closed correctly.
Related GitHub Issue
Closes: #
Roo Code Task Context (Optional)
N/A
Description
Updates AWS Bedrock Anthropic model specifications to match the latest official AWS documentation.
Key changes:
maxTokensfor Claude Sonnet 4 (anthropic.claude-sonnet-4-20250514-v1:0) from 8,192 to 64,000maxTokensfor Claude Opus 4 (anthropic.claude-opus-4-20250514-v1:0) from 8,192 to 64,000guessModelInfoFromIdheuristics for Claude 4 family in bedrock providerFiles changed:
packages/types/src/providers/bedrock.ts– Primary model definitionssrc/api/providers/bedrock.ts– Provider implementation (guessModelInfoFromId)src/api/providers/__tests__/bedrock.spec.ts– Test updatesSource: https://docs.aws.amazon.com/bedrock/latest/userguide/model-cards-anthropic.html
Test Procedure
Pre-Submission Checklist
Screenshots / Videos
N/A — no UI changes.
Documentation Updates
Additional Notes
This is a data-only fix aligning the model specs with the latest AWS Bedrock documentation for Anthropic Claude models.
Interactively review PR in Roo Code Cloud