From 6dcb9ff39dd6ca1d1ba92a44eed566ebd85e6225 Mon Sep 17 00:00:00 2001 From: Ahmed Ibrahim Date: Wed, 22 Oct 2025 16:05:32 -0700 Subject: [PATCH] clippy --- codex-rs/core/src/codex.rs | 22 +++++++++++++++------- codex-rs/core/src/error.rs | 4 ++-- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/codex-rs/core/src/codex.rs b/codex-rs/core/src/codex.rs index 7efbbc6245..1d592d4a5f 100644 --- a/codex-rs/core/src/codex.rs +++ b/codex-rs/core/src/codex.rs @@ -1657,7 +1657,9 @@ pub(crate) async fn run_task( } continue; } - Err(CodexErr::TurnAborted { processed_items }) => { + Err(CodexErr::TurnAborted { + dangling_artifacts: processed_items, + }) => { let (_responses, items_to_record_in_conversation_history) = process_items(processed_items); sess.record_conversation_items(&items_to_record_in_conversation_history) @@ -1850,8 +1852,12 @@ async fn run_turn( .await { Ok(output) => return Ok(output), - Err(CodexErr::TurnAborted { processed_items }) => { - return Err(CodexErr::TurnAborted { processed_items }); + Err(CodexErr::TurnAborted { + dangling_artifacts: processed_items, + }) => { + return Err(CodexErr::TurnAborted { + dangling_artifacts: processed_items, + }); } Err(CodexErr::Interrupted) => return Err(CodexErr::Interrupted), Err(CodexErr::EnvVar(var)) => return Err(CodexErr::EnvVar(var)), @@ -1905,9 +1911,9 @@ async fn run_turn( /// "handled" such that it produces a `ResponseInputItem` that needs to be /// sent back to the model on the next turn. #[derive(Debug)] -pub(crate) struct ProcessedResponseItem { - pub(crate) item: ResponseItem, - pub(crate) response: Option, +pub struct ProcessedResponseItem { + pub item: ResponseItem, + pub response: Option, } #[derive(Debug)] @@ -1962,7 +1968,9 @@ async fn try_run_turn( info!("Turn aborted"); let processed_items = finalize_turn(&sess, &turn_context, &turn_diff_tracker, output).await?; - return Err(CodexErr::TurnAborted { processed_items }); + return Err(CodexErr::TurnAborted { + dangling_artifacts: processed_items, + }); } }; diff --git a/codex-rs/core/src/error.rs b/codex-rs/core/src/error.rs index ab53001aaf..f5308241de 100644 --- a/codex-rs/core/src/error.rs +++ b/codex-rs/core/src/error.rs @@ -56,7 +56,7 @@ pub enum SandboxErr { pub enum CodexErr { #[error("turn aborted")] TurnAborted { - processed_items: Vec, + dangling_artifacts: Vec, }, /// Returned by ResponsesClient when the SSE stream disconnects or errors out **after** the HTTP @@ -162,7 +162,7 @@ pub enum CodexErr { impl From for CodexErr { fn from(_: CancelErr) -> Self { CodexErr::TurnAborted { - processed_items: Vec::new(), + dangling_artifacts: Vec::new(), } } }