From 62dbb4322b622a4dfa8c2d291c5d602de2f3f8fe Mon Sep 17 00:00:00 2001 From: jif-oai Date: Thu, 19 Feb 2026 15:54:42 +0000 Subject: [PATCH] Review watcher task shutdown --- codex-rs/core/src/unified_exec/process_manager.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/codex-rs/core/src/unified_exec/process_manager.rs b/codex-rs/core/src/unified_exec/process_manager.rs index 749eff53bf..dc875cba74 100644 --- a/codex-rs/core/src/unified_exec/process_manager.rs +++ b/codex-rs/core/src/unified_exec/process_manager.rs @@ -139,8 +139,10 @@ impl UnifiedExecProcessManager { let mut store = self.process_store.lock().await; store.remove(process_id) }; - if let Some(mut entry) = removed { - Self::abort_all_watcher_tasks(&mut entry); + if let Some(entry) = removed { + // Intentionally do not abort watcher tasks here. In attached flows + // (for example network denial), stream/exit watchers must finish so + // ExecCommandEnd is still emitted after forced termination. Self::unregister_network_attempt_for_entry(&entry).await; } }