mirror of
https://github.com/openai/codex.git
synced 2026-11-19 22:30:42 +00:00
Box the future returned by response item injection (#62420)
## Why Callers of `CodexThread::inject_response_items` each compile a copy of its concrete future, duplicating compilation work. ## What changed Return a `BoxFuture` from `CodexThread::inject_response_items` so the concrete future stays in the core crate. Raise the core integration test crate's recursion limit to 256. GitOrigin-RevId: 2ccb280c7887278fc8011c37df35df84c47b3e35
This commit is contained in:
@@ -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<ResponseItem>) -> CodexResult<()> {
|
||||
pub fn inject_response_items(
|
||||
&self,
|
||||
items: Vec<ResponseItem>,
|
||||
) -> 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<ResponseItem>) -> 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.
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#![recursion_limit = "256"]
|
||||
#![allow(clippy::expect_used)]
|
||||
|
||||
// Single integration test binary that aggregates all test modules.
|
||||
|
||||
Reference in New Issue
Block a user