diff --git a/codex-rs/exec/src/event_processor_with_human_output.rs b/codex-rs/exec/src/event_processor_with_human_output.rs index 9175b100a..cbe45b92f 100644 --- a/codex-rs/exec/src/event_processor_with_human_output.rs +++ b/codex-rs/exec/src/event_processor_with_human_output.rs @@ -593,17 +593,20 @@ impl EventProcessor for EventProcessorWithHumanOutput { view.path.display() ); } - EventMsg::TurnAborted(abort_reason) => match abort_reason.reason { - TurnAbortReason::Interrupted => { - ts_msg!(self, "task interrupted"); + EventMsg::TurnAborted(abort_reason) => { + match abort_reason.reason { + TurnAbortReason::Interrupted => { + ts_msg!(self, "task interrupted"); + } + TurnAbortReason::Replaced => { + ts_msg!(self, "task aborted: replaced by a new task"); + } + TurnAbortReason::ReviewEnded => { + ts_msg!(self, "task aborted: review ended"); + } } - TurnAbortReason::Replaced => { - ts_msg!(self, "task aborted: replaced by a new task"); - } - TurnAbortReason::ReviewEnded => { - ts_msg!(self, "task aborted: review ended"); - } - }, + return CodexStatus::InitiateShutdown; + } EventMsg::ContextCompacted(_) => { ts_msg!(self, "context compacted"); } diff --git a/codex-rs/exec/src/event_processor_with_jsonl_output.rs b/codex-rs/exec/src/event_processor_with_jsonl_output.rs index 823fa7b81..9675651ef 100644 --- a/codex-rs/exec/src/event_processor_with_jsonl_output.rs +++ b/codex-rs/exec/src/event_processor_with_jsonl_output.rs @@ -871,6 +871,7 @@ impl EventProcessor for EventProcessorWithJsonOutput { } CodexStatus::InitiateShutdown } + protocol::EventMsg::TurnAborted(_) => CodexStatus::InitiateShutdown, protocol::EventMsg::ShutdownComplete => CodexStatus::Shutdown, _ => CodexStatus::Running, }