Skip to content

Conversation

@blevy-oai
Copy link
Contributor

Motivation

  • The local OAuth callback server returned a generic "Invalid OAuth callback" on failures even when the query contained an error_description, making it hard to debug OAuth failures.

Description

  • Update codex-rs/rmcp-client/src/perform_oauth_login.rs to surface error_description values from the callback query in the HTTP response.
  • Introduce a CallbackOutcome enum and change parse_oauth_callback to return it, parsing code, state, and error_description from the query string.
  • Change spawn_callback_server to match on CallbackOutcome and return OAuth error: <description> with a 400 status when error_description is present, while preserving the existing success and invalid flows.
  • Use inline formatting for the error response string.

Testing

  • Ran just fmt in the codex-rs workspace to format changes successfully.
  • Ran cargo test -p codex-rmcp-client and all tests passed.

Codex Task

@blevy-oai blevy-oai self-assigned this Jan 22, 2026
@blevy-oai
Copy link
Contributor Author

Flows that fail with an error_description in the query now have a nice informative error in the body which is displayed in the browser. This makes debugging failures easier as now you don't have to copy the path out of the url bar and inspect it in a text editor

@blevy-oai blevy-oai marked this pull request as ready for review January 22, 2026 04:54
@etraut-openai etraut-openai added the oai PRs contributed by OpenAI employees label Jan 22, 2026
@blevy-oai blevy-oai requested a review from bolinfest January 26, 2026 19:42
@bolinfest bolinfest requested a review from gpeal January 26, 2026 19:49
@blevy-oai blevy-oai force-pushed the codex/log-error_description-on-oauth-failures branch from 65b16c3 to e57cb37 Compare January 26, 2026 22:26
@blevy-oai blevy-oai enabled auto-merge (squash) January 26, 2026 22:38
@blevy-oai blevy-oai disabled auto-merge January 26, 2026 22:47
@blevy-oai blevy-oai force-pushed the codex/log-error_description-on-oauth-failures branch from 4d63eab to 4a1e457 Compare January 27, 2026 00:32
@bolinfest bolinfest merged commit c7c2b3c into main Jan 27, 2026
70 of 74 checks passed
@bolinfest bolinfest deleted the codex/log-error_description-on-oauth-failures branch January 27, 2026 21:22
@github-actions github-actions bot locked and limited conversation to collaborators Jan 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

codex oai PRs contributed by OpenAI employees

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants