mirror of
https://github.com/openai/codex.git
synced 2026-10-20 17:38:45 +00:00
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
This commit is contained in:
@@ -1883,6 +1883,14 @@ impl Session {
|
||||
) {
|
||||
warn!("failed to refresh MCP auth storage config: {err}");
|
||||
}
|
||||
if let Err(err) = config.features.set_enabled(
|
||||
Feature::McpOAuthRefreshCoordination,
|
||||
next_config
|
||||
.features
|
||||
.enabled(Feature::McpOAuthRefreshCoordination),
|
||||
) {
|
||||
warn!("failed to refresh MCP OAuth coordination config: {err}");
|
||||
}
|
||||
let config = Arc::new(config);
|
||||
state.session_configuration.original_config_do_not_use = Arc::clone(&config);
|
||||
self.mark_mcp_runtime_dirty();
|
||||
@@ -1931,6 +1939,14 @@ impl Session {
|
||||
) {
|
||||
warn!("failed to refresh MCP auth storage config: {err}");
|
||||
}
|
||||
if let Err(err) = config.features.set_enabled(
|
||||
Feature::McpOAuthRefreshCoordination,
|
||||
next_config
|
||||
.features
|
||||
.enabled(Feature::McpOAuthRefreshCoordination),
|
||||
) {
|
||||
warn!("failed to refresh MCP OAuth coordination config: {err}");
|
||||
}
|
||||
state.session_configuration.original_config_do_not_use = Arc::new(config);
|
||||
self.mark_mcp_runtime_dirty();
|
||||
drop(state);
|
||||
|
||||
Reference in New Issue
Block a user