Files
codex/codex-rs/rmcp-client/src/oauth_refresh_mode.rs
T
Matthew Zeng bd89ce67cc Prepare MCP connections for coordinated OAuth refresh (#42128)
## What changed

- Add the under-development `mcp_oauth_refresh_coordination` feature and pin its selected refresh mode to each MCP connection.
- Treat the refresh mode as part of OAuth connection identity so runtime and MCP configuration refreshes reconnect when the mode changes.
- Keep legacy refresh behavior in builds where coordination is unavailable and emit a warning when coordinated mode is selected.

## Testing

- Cover connection replacement when the feature is toggled through both runtime and MCP configuration refresh paths.

GitOrigin-RevId: 89596150f0338e6ede0e712badecea4450831766
2026-09-01 20:26:57 +00:00

12 lines
395 B
Rust

//! Selects the owner of MCP OAuth refresh and credential persistence.
/// MCP OAuth policy pinned for the lifetime of a connection.
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
pub enum McpOAuthRefreshMode {
/// Keep Codex's existing refresh and persistence path.
#[default]
Legacy,
/// Let RMCP coordinate refresh through Codex's credential store.
Coordinated,
}