chore: improve expired Bedrock credential errors - #28992
Merged
Merged
Conversation
celia-oai
force-pushed
the
codex/bedrock-expired-signature-error
branch
from
June 18, 2026 22:41
1e6e48d to
481758a
Compare
celia-oai
force-pushed
the
codex/bedrock-expired-signature-error
branch
from
June 22, 2026 22:46
302648c to
e7e3628
Compare
celia-oai
marked this pull request as ready for review
June 22, 2026 22:57
pakrym-oai
reviewed
Jun 22, 2026
pakrym-oai
reviewed
Jun 22, 2026
pakrym-oai
approved these changes
Jun 22, 2026
celia-oai
force-pushed
the
codex/bedrock-expired-signature-error
branch
from
June 23, 2026 00:38
4d02a6c to
8044575
Compare
celia-oai
enabled auto-merge (squash)
June 23, 2026 00:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Amazon Bedrock returns a
401 Unauthorizedresponse containingSignature expired:when an AWS credential, including a short-livedAWS_BEARER_TOKEN_BEDROCK, has expired. Codex currently surfaces that response as a genericunexpected statuserror, which does not explain how to recover.Environment-provided bearer tokens cannot be refreshed automatically, so the error should direct users to refresh their AWS credentials or replace or remove the environment token and restart Codex. This classification belongs to the Amazon Bedrock provider so similar responses from other providers retain their existing behavior.
What changed
ModelProvider::map_api_errorhook that defaults to the existing provider-neutral API error mapping, and route model request, stream, WebSocket, and terminal unauthorized errors through the active provider.401responses containingSignature expired:and attach actionable credential guidance.codex-protocolprovider-neutral by representing the guidance as an optionaluser_message. Error rendering prefers this message while continuing to append the URL, request ID, Cloudflare ray, and authorization diagnostics.Testing
Tested with a real request with expired bedrock key:
