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

Closed
opened 2026-02-16 18:18:57 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/12281

State: closed
Merged: Yes


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.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/12281 **State:** closed **Merged:** Yes --- ### 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.
yindo added the pull-request label 2026-02-16 18:18:57 -05:00
yindo closed this issue 2026-02-16 18:18:57 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14147