fix: prevent double-prefixing of Bedrock cross-region inference models#12056
Merged
rekram1-node merged 1 commit intoanomalyco:devfrom Feb 4, 2026
Merged
Conversation
Models from models.dev may already include cross-region inference profile prefixes (us., eu., global., jp., apac., au.). Previously, only global. and jp. prefixes were checked, causing models with us., eu., apac., or au. prefixes to be double-prefixed (e.g., us.us.anthropic.claude-...). This fix expands the prefix check to include all cross-region inference profile prefixes, ensuring models that already have a regional prefix are passed through to the SDK without modification. Fixes anomalyco#12052
Contributor
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
mvclaudianobj
pushed a commit
to mvclaudianobj/markscode
that referenced
this pull request
Feb 4, 2026
ishaksebsib
pushed a commit
to ishaksebsib/opencode
that referenced
this pull request
Feb 4, 2026
ishaksebsib
pushed a commit
to ishaksebsib/opencode
that referenced
this pull request
Feb 4, 2026
dmae97
pushed a commit
to dmae97/opencode
that referenced
this pull request
Feb 5, 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
Problem
Models from models.dev may already include cross-region inference profile prefixes like:
us.anthropic.claude-opus-4-5-20251101-v1:0→ "Claude Opus 4.5 (US)"eu.anthropic.claude-opus-4-5-20251101-v1:0→ "Claude Opus 4.5 (EU)"global.anthropic.claude-opus-4-5-20251101-v1:0→ "Claude Opus 4.5 (Global)"Previously, only
global.andjp.prefixes were checked, causing models withus.,eu.,apac., orau.prefixes to be double-prefixed (e.g.,us.us.anthropic.claude-...), which AWS rejects as invalid.Solution
Expanded the prefix check to include all cross-region inference profile prefixes:
global.us.eu.jp.apac.au.Models that already have a regional prefix are now passed through to the SDK without modification, while models without prefixes continue to get prefixed based on the user's region.
Backward Compatibility
This fix is backward compatible:
anthropic.claude-opus-4-5-20251101-v1:0) will continue to be prefixed based on the user's AWS regionus.anthropic.claude-opus-4-5-20251101-v1:0) will be used as-isFixes #12052