From c695d267e3ecbe135d7570cd9c6c19792b06868c Mon Sep 17 00:00:00 2001 From: Dylan Hurd Date: Wed, 18 Nov 2026 18:06:57 +0000 Subject: [PATCH] Box the config reload future for persistent MCP tool approvals (#62337) ## Why The MCP tool call future reserves space for the large config reload future even on ordinary calls that never reload configuration. ## What changed Pin the reload future on the heap after successfully persisting a tool approval. Ordinary MCP calls no longer carry the inline storage for it. GitOrigin-RevId: a883f7619f520e730dda139d967c6a0f945b5df2 --- codex-rs/core/src/mcp_tool_call.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/codex-rs/core/src/mcp_tool_call.rs b/codex-rs/core/src/mcp_tool_call.rs index 05ceae80bc..c79c4c3da9 100644 --- a/codex-rs/core/src/mcp_tool_call.rs +++ b/codex-rs/core/src/mcp_tool_call.rs @@ -2720,7 +2720,8 @@ async fn maybe_persist_mcp_tool_approval( return; } - sess.reload_user_config_layer().await; + // Keep the config reload's large future out of ordinary MCP calls, which never poll it. + Box::pin(sess.reload_user_config_layer()).await; } async fn persist_codex_app_tool_approval(