Skip to content

fix: prevent double-prefixing of Bedrock cross-region inference models - #12056

Merged
rekram1-node merged 1 commit into
anomalyco:devfrom
sergical:fix/bedrock-cross-region-prefix
Feb 4, 2026
Merged

rekram1-node merged 1 commit into
anomalyco:devfrom
sergical:fix/bedrock-cross-region-prefix

Conversation

@sergical

@sergical sergical commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fixed issue where Bedrock models with pre-existing cross-region inference profile prefixes (us., eu., etc.) were being double-prefixed
  • Added tests for cross-region prefix detection

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. and jp. prefixes were checked, causing models with us., eu., apac., or au. 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:

  • Models without prefixes (e.g., anthropic.claude-opus-4-5-20251101-v1:0) will continue to be prefixed based on the user's AWS region
  • Models with prefixes (e.g., us.anthropic.claude-opus-4-5-20251101-v1:0) will be used as-is

Fixes #12052

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
@github-actions

github-actions Bot commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@rekram1-node
rekram1-node merged commit b942e0b into anomalyco:dev Feb 4, 2026
6 checks passed
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
Colin4k1024 pushed a commit to Colin4k1024/opencode that referenced this pull request Feb 10, 2026
schneiderlo pushed a commit to schneiderlo/opencode that referenced this pull request Feb 17, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
MarsQiu007 referenced this pull request in MarsQiu007/openNovel Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bedrock US Opus identified is invalid

2 participants