diff --git a/codex-rs/core/src/codex_thread.rs b/codex-rs/core/src/codex_thread.rs index 8b078b5061..de02e26e21 100644 --- a/codex-rs/core/src/codex_thread.rs +++ b/codex-rs/core/src/codex_thread.rs @@ -90,6 +90,7 @@ use codex_user_input::ResolvedUserInput; use codex_utils_absolute_path::AbsolutePathBuf; use codex_utils_path_uri::LegacyAppPathString; use codex_utils_path_uri::PathUri; +use futures::future::BoxFuture; use rmcp::model::ReadResourceRequestParams; use std::any::Any; use std::path::PathBuf; @@ -1135,7 +1136,15 @@ impl CodexThread { /// Inject raw Responses items. Plaintext agent-mail batches in a native MAv2 /// runtime use queue-only mailbox delivery and its existing wake policy. /// Other batches retain history-injection semantics. - pub async fn inject_response_items(&self, items: Vec) -> CodexResult<()> { + pub fn inject_response_items( + &self, + items: Vec, + ) -> BoxFuture<'_, CodexResult<()>> { + // Keep the concrete future in core so callers don't each compile their own copy. + Box::pin(self.inject_response_items_inner(items)) + } + + async fn inject_response_items_inner(&self, items: Vec) -> CodexResult<()> { let config = self.session.get_config().await; // Native mail can represent this shape without changing its payload. Keep // mixed history and multipart/encrypted items on the raw injection path. diff --git a/codex-rs/core/tests/all.rs b/codex-rs/core/tests/all.rs index 0ee0cd986a..e6828ba07f 100644 --- a/codex-rs/core/tests/all.rs +++ b/codex-rs/core/tests/all.rs @@ -1,3 +1,4 @@ +#![recursion_limit = "256"] #![allow(clippy::expect_used)] // Single integration test binary that aggregates all test modules.