core-agent-ide/codex-rs/exec/src
Rasmus Rygaard e3d39013d3
Handle exec shutdown on Interrupt (fixes immortal codex exec with websockets) (#10519)
### Motivation
- Ensure `codex exec` exits when a running turn is interrupted (e.g.,
Ctrl-C) so the CLI is not "immortal" when websockets/streaming are used.

### Description
- Return `CodexStatus::InitiateShutdown` when handling
`EventMsg::TurnAborted` in
`exec/src/event_processor_with_human_output.rs` so human-output exec
mode shuts down after an interrupt.
- Treat `protocol::EventMsg::TurnAborted` as
`CodexStatus::InitiateShutdown` in
`exec/src/event_processor_with_jsonl_output.rs` so JSONL output mode
behaves the same.
- Applied formatting with `just fmt`.

### Testing
- Ran `just fmt` successfully.
- Ran `cargo test -p codex-exec`; many unit tests ran and the test
command completed, but the full test run in this environment produced
`35 passed, 11 failed` where the failures are due to Landlock sandbox
panics and 403 responses in the test harness (environmental/integration
issues) and are not caused by the interrupt/shutdown changes.

------
[Codex
Task](https://chatgpt.com/codex/tasks/task_i_698165cec4e083258d17702bd29014c1)
2026-02-03 14:38:21 -08:00
..
cli.rs chore: nuke chat/completions API (#10157) 2026-02-03 11:31:57 +00:00
event_processor.rs Minor cleanup of codex exec output (#4585) 2025-10-02 14:17:42 -07:00
event_processor_with_human_output.rs Handle exec shutdown on Interrupt (fixes immortal codex exec with websockets) (#10519) 2026-02-03 14:38:21 -08:00
event_processor_with_jsonl_output.rs Handle exec shutdown on Interrupt (fixes immortal codex exec with websockets) (#10519) 2026-02-03 14:38:21 -08:00
exec_events.rs feat: replace custom mcp-types crate with equivalents from rmcp (#10349) 2026-02-02 17:41:55 -08:00
lib.rs chore: nuke chat/completions API (#10157) 2026-02-03 11:31:57 +00:00
main.rs feat: codex exec auto-subscribe to new threads (#9821) 2026-01-28 14:03:20 +01:00