Skip to content

Preserve MCP OAuth manager credentials on reread errors#349

Merged
GraciousGazelles merged 3 commits into
mainfrom
codex/mcp-oauth-auto-reread-errors
Jun 20, 2026
Merged

Preserve MCP OAuth manager credentials on reread errors#349
GraciousGazelles merged 3 commits into
mainfrom
codex/mcp-oauth-auto-reread-errors

Conversation

@GraciousGazelles

Copy link
Copy Markdown
Collaborator

Summary

  • Port the relevant behavior from upstream branch dev/stevenlee/mcp-oauth-stack-6-auto-read-errors / commit 2b64cf47db in downstream-shaped form.
  • Keep refresh rereads pinned to the already resolved credential backend, so keyring reread errors fail closed instead of clearing active request credentials.
  • Add a regression test proving the RMCP manager still has the request-only access token after a keyring reread failure aborts refresh.

Validation

  • rustfmt --check codex-rs/rmcp-client/src/oauth.rs
  • git diff --check
  • cargo test -p codex-rmcp-client --lib oauth::tests::refresh_transaction_keeps_manager_credentials_on_keyring_reread_error -- --exact

Upstream harvest note

  • The earlier OAuth stack PRs were already covered by [codex] Serialize MCP OAuth credential refreshes #347. A refreshed harvest also found upstream branch dev/stevenlee/mcp-oauth-stack-6-auto-read-errors with no open PR at the time of inspection; this PR lands the relevant downstream-compatible regression coverage and refresh reread seam.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the OAuth token refresh mechanism to support a generic keyring store, improving testability. It introduces a helper function for loading tokens during refresh and adds a unit test to verify credential retention on keyring reread errors. The review feedback suggests ensuring proper initialization of the AuthorizationManager in the test helper by calling initialize_from_store and simplifying redundant type paths.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread codex-rs/rmcp-client/src/oauth.rs
…reread-errors

# Conflicts:
#	codex-rs/rmcp-client/src/oauth.rs
@GraciousGazelles GraciousGazelles enabled auto-merge (squash) June 20, 2026 12:23
@GraciousGazelles GraciousGazelles merged commit 90a3ab7 into main Jun 20, 2026
38 checks passed
@GraciousGazelles GraciousGazelles deleted the codex/mcp-oauth-auto-reread-errors branch June 20, 2026 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant