core-agent-ide/codex-rs/rmcp-client/src
blevy-oai c7c2b3cf8d
Show OAuth error descriptions in callback responses (#9654)
### 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](https://chatgpt.com/codex/tasks/task_i_6971aadc68d0832e93159efea8cd48a9)
2026-01-27 13:22:54 -08:00
..
bin Fix: Render MCP image outputs regardless of ordering (#9815) 2026-01-27 21:14:08 +00:00
auth_status.rs Work around crash in system-configuration library (#8954) 2026-01-09 08:11:34 -07:00
find_codex_home.rs [MCP] Add support for MCP Oauth credentials (#4517) 2025-10-03 13:43:12 -04:00
lib.rs [connectors] Support connectors part 1 - App server & MCP (#9667) 2026-01-22 16:48:43 -08:00
logging_client_handler.rs support MCP elicitations (#6947) 2025-11-21 14:44:53 -08:00
oauth.rs add generated jsonschema for config.toml (#8956) 2026-01-13 10:22:51 -08:00
perform_oauth_login.rs Show OAuth error descriptions in callback responses (#9654) 2026-01-27 13:22:54 -08:00
program_resolver.rs fix: resolve Windows MCP server execution for script-based tools (#3828) 2025-11-16 13:41:10 -08:00
rmcp_client.rs [connectors] Support connectors part 1 - App server & MCP (#9667) 2026-01-22 16:48:43 -08:00
utils.rs fix(windows-path): preserve PATH order; include core env vars (#5579) 2025-10-28 21:06:39 -07:00