Serialize authoritative MCP OAuth refresh transactions#30416
Conversation
|
@codex review — Codex |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1df2d68e70
ℹ️ 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".
|
@codex review — Codex |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Codex Thread 019edd6d-6f14-74e2-853c-345d1803d4a6
Stack
Review and merge in order. Every layer is independently correct and documents its safe stopping point.
This PR is layer 3.
Why
Pinning one credential store prevents a client from hot-switching between stale authorities, but it does not stop two processes from refreshing the same rotating token concurrently. Both can send R1; one persists R2, while the other can replay R1 or overwrite the winner. Refresh must be one serialized read-refresh-write transaction based on a reread made after taking the credential lock.
What this PR does
compute_store_key(server_name, url)under the activeCODEX_HOME.Explicit decisions
CODEX_HOMEvalues remains out of scope until there is a safe cross-platform rendezvous.Safe stopping point
This PR independently fixes startup and public-operation preflight refresh races. RMCP-owned GET/DELETE/server-response traffic and one-shot 401 recovery remain unchanged until layer 4.
Review size
The net layer is 8 files, +757/−43. About 430 additions are production code; the remainder is focused concurrency and failure-path coverage.
Validation
just test -p codex-rmcp-client(103 passed; expected environment skips)cargo shear