Skip to content

[codex] Report unusable MCP OAuth credentials as logged out - #26713

Merged
anp-oai merged 2 commits into
mainfrom
codex/expired-oauth-auth-status-regression
Jun 9, 2026
Merged

[codex] Report unusable MCP OAuth credentials as logged out#26713
anp-oai merged 2 commits into
mainfrom
codex/expired-oauth-auth-status-regression

Conversation

@anp-oai

@anp-oai anp-oai commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Why

Persisted MCP OAuth credentials were reported as authenticated whenever a credential record existed. An expired token without a usable refresh token could therefore appear as OAuth even though startup could not authenticate with it, leaving users with a misleading status instead of a login prompt.

What changed

  • Classify stored OAuth credentials as missing, usable, or requiring authorization.
  • Reuse the existing refresh window so near-expiry credentials without a refresh path are also treated as logged out.
  • Validate required credential fields before reporting OAuth authentication.
  • Add unit coverage for credential usability and integration coverage for expired, unexpired, and refreshable persisted credentials.

Validation

  • just test -p codex-rmcp-client

@etraut-openai etraut-openai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Change looks good.

I built locally and had Codex do a manual test with a mock MCP server and tested four cases: auth valid, no auth, refresh succeeds, refresh fails. All of them worked as expected.

@anp-oai
anp-oai force-pushed the codex/expired-oauth-auth-status-regression branch from be77938 to f5101b8 Compare June 9, 2026 20:50
@anp-oai
anp-oai merged commit f574946 into main Jun 9, 2026
31 checks passed
@anp-oai
anp-oai deleted the codex/expired-oauth-auth-status-regression branch June 9, 2026 21:18
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants