CLI bug: Codex leaves an interrupted child process running

Open 💬 1 comment Opened Jun 12, 2026 by N0zoM1z0

What version of Codex CLI is running?

Codex CLI 0.137.0

What subscription do you have?

N/A. The reproduction uses a local OpenAI-compatible mock provider and a fake API key.

Which model were you using?

gpt-4 in the local mock-provider replay.

What platform is your computer?

Linux x86_64 in Docker (node:24-bookworm)

What terminal emulator and version are you using (if applicable)?

Non-interactive Docker/CI shell.

Codex doctor report

Not available in this minimal Docker reproduction.

What issue are you seeing?

A Bash tool invocation starts a child process and SIGINT is delivered during execution. Codex does not fully clean up the child process after cancellation.

What steps can reproduce the bug?

Standalone reproduction

Prerequisites: Docker, Python 3, and the GitHub CLI (gh) for the clone command below. The linked reproducer is self-contained and uses only Python standard-library modules plus Docker. It builds the affected CLI version from the public upstream package/release source and starts a local mock provider; it does not require this repository or any private fuzzing harness. The Docker run is limited to 2 CPUs and 4 GiB RAM by default.

Complete self-contained reproducer: https://gist.github.com/N0zoM1z0/03d13dd934af103904ac5d8f9bfb7d00

The Gist contains codex-interrupt-child-process-orphan.reproduce.py. Download and run:

gh gist clone 03d13dd934af103904ac5d8f9bfb7d00 codex-interrupt-child-process-orphan-reproducer
cd codex-interrupt-child-process-orphan-reproducer
python3 codex-interrupt-child-process-orphan.reproduce.py

To reuse an already-built local image:

python3 codex-interrupt-child-process-orphan.reproduce.py --skip-build

Key output from a local run against the affected version:

process_exit=-9
provider_requests=211
tool_result_counts={'interrupt_child_process': 22155}
late_stream_events_after_stop=0
side_effect_file_contains interrupt-child.marker 'child-started-after-interrupt-window': observed=True
REPRODUCED

What is the expected behavior?

When a tool execution is interrupted, Codex should terminate/reap child processes it started before returning control.

Additional information

No.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗