From 0abaf1b57c2f0f6500d6fd68db0b2f0a57c7ae1d Mon Sep 17 00:00:00 2001 From: jif-oai Date: Wed, 17 Dec 2025 13:24:02 +0000 Subject: [PATCH] nit: prevent race in event rendering (#8181) --- codex-rs/core/src/unified_exec/session_manager.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codex-rs/core/src/unified_exec/session_manager.rs b/codex-rs/core/src/unified_exec/session_manager.rs index 4b24c574a..17d5ef671 100644 --- a/codex-rs/core/src/unified_exec/session_manager.rs +++ b/codex-rs/core/src/unified_exec/session_manager.rs @@ -175,7 +175,6 @@ impl UnifiedExecSessionManager { // Short‑lived command: emit ExecCommandEnd immediately using the // same helper as the background watcher, so all end events share // one implementation. - self.release_process_id(&request.process_id).await; let exit = exit_code.unwrap_or(-1); emit_exec_end_for_unified_exec( Arc::clone(&context.session), @@ -191,6 +190,7 @@ impl UnifiedExecSessionManager { ) .await; + self.release_process_id(&request.process_id).await; session.check_for_sandbox_denial_with_text(&text).await?; } else { // Long‑lived command: persist the session so write_stdin can reuse