anomalyco / anomalyco/opencode
bug(provider): Bedrock au. prefix skips Claude Opus in ap-southeast-2/4
@neriousy is already working on this.
Since Sep 15, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Summary
In ap-southeast-2 / ap-southeast-4, the Bedrock provider only applies the au. cross-region inference prefix to Sonnet 4.5 and Haiku. Claude Opus (and Sonnet 4.6) fall through to the generic apac. prefix, producing a model identifier that does not exist in the Australia geography.
Evidence
packages/opencode/src/provider/provider.ts (AU branch of getModel):
const isAustraliaRegion = ["ap-southeast-2", "ap-southeast-4"].includes(region)
...
if (
isAustraliaRegion &&
["anthropic.claude-sonnet-4-5", "anthropic.claude-haiku"].some((m) => modelID.includes(m))
) {
regionPrefix = "au"
modelID = `${regionPrefix}.${modelID}`
} else {
// Other APAC regions use apac. prefix
...
regionPrefix = "apac"
}
An Opus model ID does not match the allowlist, so it is prefixed apac. instead of au., and Bedrock rejects it in the AU regions.
AWS documents Claude Opus 4.6, Sonnet 4.6, and Haiku 4.5 as available via cross-region inference in the APAC/Australia geography: https://aws.amazon.com/blogs/machine-learning/global-cross-region-inference-for-latest-anthropic-claude-opus-sonnet-and-haiku-models-on-amazon-bedrock-in-thailand-malaysia-singapore-indonesia-and-taiwan/
Impact
Selecting an Opus (or Sonnet 4.6) Bedrock model in ap-southeast-2/ap-southeast-4 fails with an invalid model identifier error. Setting the model ID explicitly with an au. prefix works because of the existing crossRegionPrefixes passthrough, but automatic prefixing does not.
Prior context
- #15182 (AU Opus 4.6 / Sonnet 4.6 request) — closed as duplicate, no fix.
- #12824 (APAC invalid model identifier) — closed stale; documents the same root cause.
- #3050 (merged) added
au.for Sonnet 4.5 / Haiku only.
Proposed fix
Broaden the AU match to the claude family for the Australia regions (mirroring the eu/apac branches) rather than maintaining a per-version allowlist that goes stale. PR to follow.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.