From 654fcb49621475b4a9c39943c67f71262320b656 Mon Sep 17 00:00:00 2001 From: Matthew Zeng Date: Tue, 3 Feb 2026 12:17:53 -0800 Subject: [PATCH] [apps] Gateway MCP should be blocking. (#10289) Make Apps Gateway MCP blocking since otherwise app mentions may not work when apps are not loaded. Messages sent before apps become available will be queued. This only affects when `apps` feature is enabled. --- codex-rs/core/src/mcp_connection_manager.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/codex-rs/core/src/mcp_connection_manager.rs b/codex-rs/core/src/mcp_connection_manager.rs index 1a5ec559b..c5fbb8ec3 100644 --- a/codex-rs/core/src/mcp_connection_manager.rs +++ b/codex-rs/core/src/mcp_connection_manager.rs @@ -463,16 +463,8 @@ impl McpConnectionManager { #[instrument(level = "trace", skip_all)] pub async fn list_all_tools(&self) -> HashMap { let mut tools = HashMap::new(); - for (server_name, managed_client) in &self.clients { - let client = if server_name == CODEX_APPS_MCP_SERVER_NAME { - // Avoid blocking on codex_apps_mcp startup; use tools only when ready. - match managed_client.client.clone().now_or_never() { - Some(Ok(client)) => Some(client), - _ => None, - } - } else { - managed_client.client().await.ok() - }; + for managed_client in self.clients.values() { + let client = managed_client.client().await.ok(); if let Some(client) = client { tools.extend(qualify_tools(filter_tools( client.tools,