Skip to content

fix(opencode): correct prefix selection for amazon-bedrock provider in getSmallModel#12281

Open
NachoFLizaur wants to merge 1 commit intoanomalyco:devfrom
NachoFLizaur:fix/bedrock-small-model-prefix
Open

fix(opencode): correct prefix selection for amazon-bedrock provider in getSmallModel#12281
NachoFLizaur wants to merge 1 commit intoanomalyco:devfrom
NachoFLizaur:fix/bedrock-small-model-prefix

Conversation

@NachoFLizaur
Copy link

What does this PR do?

Fixes #12280

getSmallModel() returns the first model matching a priority string from the provider models. Due to models.dev JSON key ordering, EU-prefixed models are returned first, causing title generation to fail when the configured AWS Region is not in eu.

The fix adds Bedrock-specific logic to prefer global. prefixed models, with fallback to regional prefix (us., eu.) depending on the user's region.

Support for other regional prefixes (jp, apac, au) not added as models.dev doesn't support them at the moment.

How did you verify your code works?

After the fix, I tested by setting AWS_REGION to a non-european region (us-west-2) and verifying that the title was generated correctly.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

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

No duplicate PRs found

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.

Session title generation fails for non-EU Amazon Bedrock regions

1 participant