From 9ab3dd8b9f8b819aa6bf432d93316872a160d3b3 Mon Sep 17 00:00:00 2001 From: stevenlee-oai Date: Wed, 15 Jul 2026 20:45:38 +0000 Subject: [PATCH] Load executor plugin declarations concurrently (#33423) ## Why MCP server and app connector declarations live in separate executor-owned files. Reading them sequentially makes remote environments pay the latency of both reads. ## What changed Load both declaration files concurrently while preserving independent error handling for each result. GitOrigin-RevId: 067e6d1677987ba52200b759a55cec6129575d4b --- codex-rs/ext/mcp/src/executor_plugin.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/codex-rs/ext/mcp/src/executor_plugin.rs b/codex-rs/ext/mcp/src/executor_plugin.rs index 3597e100d8..12c0a99686 100644 --- a/codex-rs/ext/mcp/src/executor_plugin.rs +++ b/codex-rs/ext/mcp/src/executor_plugin.rs @@ -87,7 +87,14 @@ impl SelectedExecutorPluginMcpContributor { }; let metadata = match plugin { Some(plugin) => { - let servers = self.mcp_provider.load(&plugin).await.unwrap_or_else(|err| { + // MCP server declarations and app connector declarations are separate + // executor-owned files. Read them together so a remote environment only + // pays for the slower read instead of both reads back-to-back. + let (servers, connector_declarations) = tokio::join!( + self.mcp_provider.load(&plugin), + self.connector_provider.load(&plugin) + ); + let servers = servers.unwrap_or_else(|err| { tracing::warn!( selected_root = selected_root.id, error = %err, @@ -95,10 +102,7 @@ impl SelectedExecutorPluginMcpContributor { ); Vec::new() }); - let connector_ids = self - .connector_provider - .load(&plugin) - .await + let connector_ids = connector_declarations .unwrap_or_else(|err| { tracing::warn!( selected_root = selected_root.id,