Repository navigation
Conversation
Signed-off-by: Steven Lee <stevenlee@openai.com>
stevenlee-oai
requested review from
a team,
derekwaynecarr,
mrunalp and
sjenning
as code owners
October 9, 2026 20:18
Collaborator
|
/ok to test 5c9b79e |
|
Label |
mrunalp
approved these changes
Oct 9, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
A revision-based credential alias works while its issued revision remains cached. After credential rotation evicts that revision, the normal placeholder can fall back to the current credential for the same provider identity, but the equivalent alias fails to take that fallback and returns
Unavailable.Convert the alias into the normal placeholder before lookup so both forms use the existing revision-fallback logic. Also preserve
EndpointMismatchreporting when an alias is used at a disallowed endpoint.Related Issue
Closes #4382.
Replaces #4383, which the contributor gate closed before the author was vouched.
Changes
Both forms work initially
Suppose OpenShell issues credential revision 50. These two values identify the same credential;
HandPstand for encoded JWT header and payload segments:While revision 50 remains cached and usable, both resolve successfully. JWT is only an example of the existing alias convention; the bug also affects non-JWT aliases.
The failure starts when the old revision leaves the cache
After enough credential updates, revision 50 leaves the eight-generation retention window. OpenShell already allows an old issued revision to use the current credential if it still belongs to the current provider identity.
Before this fix:
The refreshed credential is available. The alias path simply never reaches the existing fallback for it. These are opaque credential-state revisions, not software versions, and they need not increase numerically.
Normalize first, then use the existing resolver
The fix moves alias conversion to the start of
resolve_placeholder():Both forms now follow the same exact lookup and authorized revision fallback. Remove the redundant late alias path. Old aliases remain rejected when their provider identity is removed or replaced; expiry and endpoint restrictions still apply.
The second change extracts the actual environment key from revision and stable-handle alias suffixes in
placeholder_env_key(). A wrong-endpoint alias now reportsEndpointMismatchinstead ofUnavailable; both versions reject that request.This is an alias-resolution lifecycle fix, not a JWT parsing or refresh-exchange fix. Stable-handle aliases already work across rotation on
main. Ordinary bearer tokens without reserved markers remain unchanged. Documentation describes JWT-shaped aliases as one use of the existing convention.Testing
mainresolver at61d42102c.cargo test --locked -p openshell-core --lib: 535 passed. An initial run hit an unrelatede2fsprogstemporary-scriptText file busyerror; the complete rerun passed.cargo clippy --locked -p openshell-core --all-targets -- -D warningsand changed-file Rust formatting checks passed.check: zero errors; docs navigation check passed. Fern reports existing gateway-configuration MDX and theme-contrast warnings, and skips authenticated redirect checking without a token.Checklist