app-server: box request dispatch future to reduce stack pressure (#12421)

This commit is contained in:
Charley Cunningham 2026-02-23 10:05:41 -08:00 committed by GitHub
parent 5221575f23
commit 3cea3e665e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;
}
}