Skip to content

fix: Bedrock API key region fallback#25171

Merged
celia-oai merged 2 commits into
mainfrom
dev/cc/region-fix
May 30, 2026
Merged

fix: Bedrock API key region fallback#25171
celia-oai merged 2 commits into
mainfrom
dev/cc/region-fix

Conversation

@celia-oai
Copy link
Copy Markdown
Collaborator

Why

Users following the Amazon Bedrock API-key setup can export AWS_BEARER_TOKEN_BEDROCK and AWS_REGION, but Codex's bearer-token auth path only accepted model_providers.amazon-bedrock.aws.region. That made the documented env-based setup fail with a missing-region error even though the standard AWS region environment variable was present.

What Changed

  • Updates Bedrock bearer-token region resolution to use model_providers.amazon-bedrock.aws.region first, then fall back to AWS_REGION, then AWS_DEFAULT_REGION.
  • Updates the missing-region error to list all supported region sources.
  • Adds focused coverage for config precedence, AWS_REGION, AWS_DEFAULT_REGION, and the missing-region failure.

@celia-oai celia-oai force-pushed the dev/cc/region-fix branch from c61ca72 to 04bc2fe Compare May 29, 2026 23:00
@celia-oai celia-oai force-pushed the dev/cc/region-fix branch from 04bc2fe to caa27e8 Compare May 29, 2026 23:02
@celia-oai celia-oai marked this pull request as ready for review May 29, 2026 23:05
@celia-oai
Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. What shall we delve into next?

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@celia-oai celia-oai requested a review from owenlin0 May 29, 2026 23:18
Comment thread codex-rs/model-provider/src/amazon_bedrock/auth.rs Outdated
Copy link
Copy Markdown
Collaborator

@owenlin0 owenlin0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit about tests, but logic lgtm

@celia-oai celia-oai enabled auto-merge (squash) May 30, 2026 01:02
@celia-oai celia-oai merged commit 00ca857 into main May 30, 2026
31 checks passed
@celia-oai celia-oai deleted the dev/cc/region-fix branch May 30, 2026 01:17
@github-actions github-actions Bot locked and limited conversation to collaborators May 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants