[rmcp-client] Serialize shared MCP OAuth stores#29021
Open
stevenlee-oai wants to merge 1 commit into
Open
Conversation
This was referenced Jun 19, 2026
73edd11 to
2baa0c1
Compare
c81db4f to
b723a59
Compare
2baa0c1 to
98c3fc1
Compare
0da283d to
50cbb47
Compare
98c3fc1 to
38b1739
Compare
50cbb47 to
4d5fa46
Compare
0a1fd12 to
f928100
Compare
0c1a341 to
8926a37
Compare
f928100 to
966f233
Compare
8926a37 to
a548c67
Compare
ac8101b to
25011b8
Compare
a548c67 to
e6aa44f
Compare
25011b8 to
c37c566
Compare
c37c566 to
b44ee7c
Compare
e6aa44f to
e7cdf26
Compare
e7cdf26 to
f6102b4
Compare
b44ee7c to
3628ccf
Compare
This was referenced Jun 25, 2026
f6102b4 to
b614316
Compare
3628ccf to
606864f
Compare
b614316 to
349a7f4
Compare
606864f to
0b3dcef
Compare
349a7f4 to
a727719
Compare
0b3dcef to
b210375
Compare
674f690 to
4c3d976
Compare
b210375 to
2b88193
Compare
4c3d976 to
a6f054b
Compare
51cdac5 to
fdb60d6
Compare
a6f054b to
b60ae97
Compare
fdb60d6 to
665d653
Compare
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.
Codex Thread 019edd6d-6f14-74e2-853c-345d1803d4a6
Important
This PR belongs to the superseded MCP OAuth stack. Please review and merge the replacement stack beginning with openai/codex#30292. This PR remains available only as historical/reference context.
Replacement review order:
This is part 3 of a five-PR stack that prevents concurrent MCP OAuth refreshes from replaying a rotating refresh token or overwriting newer credentials.
Review order
Autoresolution drift (this PR)Why
The per-credential transaction lock protects one OAuth authority, but File and Secrets each store multiple server credentials in one aggregate document. Two different credential identities can still race a read-modify-write and lose each other's update.
Separately, lifecycle-local
Autoresolution can choose a different store in a later process if keyring availability changes. Persisting that choice as authority would require migration and reconciliation policy that is intentionally outside this stack, but silently changing stores makes field failures hard to diagnose. This layer records only enough token-free history to surface that drift.What changes
$CODEX_HOME/.mcp-oauth-store-resolutions.jsondiagnostic map, serialized with its own short best-effort lock and atomic writes.compute_store_key(server_name, url)and store onlystore_mode,keyring_backend, andresolved_store; no tokens or raw URL are added.Autodifferently under the same keyring backend, emit a warning and incrementcodex.mcp.oauth.store_resolution_changedwith low-cardinality previous/current/reason tags.WouldBlockcontention for diagnostics and deterministic regression tests.Decisions encoded by this stack
CODEX_HOME, matching File/Secrets state. Distinct homes do not share an authority registry.Autochoice without resurrecting credentials.Autonever switches stores during one client lifecycle.Review focus
Review store scope, lock ordering, whether unrelated credential entries survive concurrent read-modify-writes, and the hard boundary between diagnostic history and credential authority.
Non-goals
Validation
just test -p codex-rmcp-client: 90 passed, 2 skipped at this layer.