mirror of
https://github.com/openai/codex.git
synced 2026-04-30 03:12:20 +03:00
feat: do not close unified exec processes across turns (#10799)
With this PR we do not close the unified exec processes (i.e. background terminals) at the end of a turn unless: * The user interrupt the turn * The user decide to clean the processes through `app-server` or `/clean` I made sure that `codex exec` correctly kill all the processes
This commit is contained in:
@@ -530,6 +530,14 @@ pub async fn run_main(cli: Cli, codex_linux_sandbox_exe: Option<PathBuf>) -> any
|
||||
thread,
|
||||
event,
|
||||
} = envelope;
|
||||
if matches!(event.msg, EventMsg::Error(_)) {
|
||||
error_seen = true;
|
||||
}
|
||||
if shutdown_requested
|
||||
&& !matches!(&event.msg, EventMsg::ShutdownComplete | EventMsg::Error(_))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if let EventMsg::ElicitationRequest(ev) = &event.msg {
|
||||
// Automatically cancel elicitation requests in exec mode.
|
||||
thread
|
||||
@@ -554,9 +562,6 @@ pub async fn run_main(cli: Cli, codex_linux_sandbox_exe: Option<PathBuf>) -> any
|
||||
shutdown_requested = true;
|
||||
}
|
||||
}
|
||||
if matches!(event.msg, EventMsg::Error(_)) {
|
||||
error_seen = true;
|
||||
}
|
||||
if thread_id != primary_thread_id && matches!(&event.msg, EventMsg::TurnComplete(_)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user