From c5f5d215d411bcf0e6bccdae5320458ec3ec0109 Mon Sep 17 00:00:00 2001 From: Charles Cunningham Date: Fri, 20 Feb 2026 00:14:17 -0800 Subject: [PATCH] core: close unified exec on tool interrupt --- codex-rs/core/src/codex.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/codex-rs/core/src/codex.rs b/codex-rs/core/src/codex.rs index 8eca7e5c1e..bca182b395 100644 --- a/codex-rs/core/src/codex.rs +++ b/codex-rs/core/src/codex.rs @@ -5044,6 +5044,10 @@ pub(crate) async fn run_turn( } = sampling_request_output; if interrupted_tool_result { cancellation_token.cancel(); + // Keep interrupt cleanup consistent with abort_all_tasks(): a parallel + // unified-exec tool call may still be running when request_user_input + // returns an interrupted result. + sess.close_unified_exec_processes().await; sess.finish_turn_without_completion_event(turn_context.as_ref()) .await; // Defer TurnAborted emission until run_turn unwinds so the caller can