Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

exec-server: wait for close after observed exit (#19130)

jif-oai45e1742030ea
diff --git a/codex-rs/exec-server/src/local_process.rs b/codex-rs/exec-server/src/local_process.rs
index aa88e37fdd..6446c36507 100644
--- a/codex-rs/exec-server/src/local_process.rs
+++ b/codex-rs/exec-server/src/local_process.rs
@@ -323,8 +323,11 @@ impl LocalProcess {
)
};
+ let has_new_terminal_event =
+ response.exited && after_seq < response.next_seq.saturating_sub(1);
if !response.chunks.is_empty()
- || response.exited
+ || response.closed
+ || has_new_terminal_event
|| tokio::time::Instant::now() >= deadline
{
let _total_bytes: usize = response