From 53f50203af6cac2fbb778e5e95e0ce668c71cb4b Mon Sep 17 00:00:00 2001 From: Charles Cunningham Date: Fri, 20 Feb 2026 20:20:30 -0800 Subject: [PATCH] app-server: box request dispatch future to reduce stack use --- codex-rs/app-server/src/message_processor.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/codex-rs/app-server/src/message_processor.rs b/codex-rs/app-server/src/message_processor.rs index e80e1790f880..de4418f0e937 100644 --- a/codex-rs/app-server/src/message_processor.rs +++ b/codex-rs/app-server/src/message_processor.rs @@ -49,6 +49,7 @@ use codex_core::default_client::set_default_originator; use codex_feedback::CodexFeedback; use codex_protocol::ThreadId; use codex_protocol::protocol::SessionSource; +use futures::FutureExt; use tokio::sync::broadcast; use tokio::time::Duration; use tokio::time::timeout; @@ -386,8 +387,12 @@ impl MessageProcessor { .await; } other => { + // Box the delegated future so this wrapper's async state machine does not + // inline the full `CodexMessageProcessor::process_request` future, which + // can otherwise push worker-thread stack usage over the edge. self.codex_message_processor .process_request(connection_id, other) + .boxed() .await; } }