Files
codex/codex-rs/codex-mcp/src
jif 67fb9da4b6 Preserve safe enterprise MCP authentication error details (#56153)
## Why

Enterprise MCP token exchange and sign-in failures can collapse into generic errors, hiding useful diagnostics such as an OAuth `invalid_scope` rejection or a cancelled sign-in.

## What changed

Introduce `EmaErrorDetail` to carry static operation messages and sanitized SDK diagnostics through token-source errors and enterprise login completion. Exchange failures can report the stage, HTTP status, and allowlisted OAuth error code, such as `IdentityProvider: HTTP 400: invalid_scope`, without retaining arbitrary provider text or raw error chains.

Preserve specific discovery, credential storage, cancellation, and account/configuration mismatch errors instead of replacing them with generic failure messages.

## Testing

Extend tests to cover `invalid_scope` diagnostics, specific sign-in completion errors, and exclusion of credentials from diagnostics even when an outer error context contains sensitive text.

GitOrigin-RevId: e9280a5db3565ea91da0810bab528da5ee088d64
2026-10-22 11:51:23 +00:00
..
2026-07-29 17:38:20 +00:00