Description
After upgrading from 2.0.3 to 2.0.4, Bedrock model initialization started failing with an error about AWS_REGION being required. The matching error in the source is:
Cannot initialize amazon-bedrock/<model>: AWS_REGION is required to resolve the provider endpoint
Expected: Bedrock Mantle endpoint templates should use the configured/default provider region without requiring a separate AWS_REGION environment variable.
The likely regression is #48943, commit 2226afaea5. In 2.0.3, AISDKNative.map ran during model resolution, after provider/model settings were merged. In 2.0.4, AISDKNative.rewrite runs separately on provider/model writes. A provider-level region and model-level baseURL containing ${AWS_REGION} are therefore normalized separately, then merged too late for the placeholder substitution. ModelResolver.prepareProviderURL subsequently checks only process.env and rejects the unresolved URL.
cc @rekram1-node — could you take a look at this possible regression from #48943?
OpenCode version
Reported working: 2.0.3. Reported broken: 2.0.4. Currently running 2.0.3 again. The relevant implementation is also unchanged in the 2.0.5 source inspected.
The merged settings contain a region, but endpoint validation can still fail before AWS credential resolution. Existing region tests provide region and baseURL together in one model settings object, so they do not cover this split provider/model case.
Plugins
No response
OpenCode version
2.0.4-2.0.5
Steps to reproduce
- Configure Bedrock with a working AWS profile and a provider-level region, such as
us-west-2.
- Leave
AWS_REGION unset in the server process environment.
- Select a Mantle model whose catalog entry supplies a model-level endpoint such as
https://bedrock-mantle.${AWS_REGION}.api.aws/openai/v1.
- Submit a prompt on 2.0.4.
Screenshot and/or share link
No response
Operating System
Linux x86_64, kernel 6.12
Terminal
tmux (TERM=xterm-256color, COLORTERM=truecolor), zsh. Diagnostics collected after returning to 2.0.3.
Description
After upgrading from 2.0.3 to 2.0.4, Bedrock model initialization started failing with an error about
AWS_REGIONbeing required. The matching error in the source is:Expected: Bedrock Mantle endpoint templates should use the configured/default provider region without requiring a separate
AWS_REGIONenvironment variable.The likely regression is #48943, commit 2226afaea5. In 2.0.3,
AISDKNative.mapran during model resolution, after provider/model settings were merged. In 2.0.4,AISDKNative.rewriteruns separately on provider/model writes. A provider-levelregionand model-levelbaseURLcontaining${AWS_REGION}are therefore normalized separately, then merged too late for the placeholder substitution.ModelResolver.prepareProviderURLsubsequently checks onlyprocess.envand rejects the unresolved URL.cc @rekram1-node — could you take a look at this possible regression from #48943?
OpenCode version
Reported working: 2.0.3. Reported broken: 2.0.4. Currently running 2.0.3 again. The relevant implementation is also unchanged in the 2.0.5 source inspected.
The merged settings contain a region, but endpoint validation can still fail before AWS credential resolution. Existing region tests provide
regionandbaseURLtogether in one model settings object, so they do not cover this split provider/model case.Plugins
No response
OpenCode version
2.0.4-2.0.5
Steps to reproduce
us-west-2.AWS_REGIONunset in the server process environment.https://bedrock-mantle.${AWS_REGION}.api.aws/openai/v1.Screenshot and/or share link
No response
Operating System
Linux x86_64, kernel 6.12
Terminal
tmux (
TERM=xterm-256color,COLORTERM=truecolor), zsh. Diagnostics collected after returning to 2.0.3.