[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.
This commit is contained in:
Matthew Zeng
2026-02-03 12:17:53 -08:00
committed by GitHub
parent 998eb8f32b
commit 654fcb4962

View File

@@ -463,16 +463,8 @@ impl McpConnectionManager {
#[instrument(level = "trace", skip_all)]
pub async fn list_all_tools(&self) -> HashMap<String, ToolInfo> {
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,