codex icon indicating copy to clipboard operation
codex copied to clipboard

Interrupting Codex CLI does not terminate spawned child processes (runaway background jobs)

Open Icarus603 opened this issue 1 week ago • 1 comments

What version of Codex is running?

codex-cli 0.72.0

What subscription do you have?

plus

Which model were you using?

gpt-5.2

What platform is your computer?

Darwin 24.6.0 arm64 arm

What issue are you seeing?

When interrupting an active Codex CLI session (e.g. via Esc), the Codex interaction stops but spawned commands may continue running in the background.

This can lead to uncontrolled runaway processes (e.g. crawlers repeatedly spawning Chrome instances), even though the user explicitly intended to stop execution.

Example: Codex was running a uv-based crawler that launched Chrome for scraping. I exited the session using Esc, but the crawler continued running in the background, repeatedly opening Chrome windows and consuming resources, with no visibility or easy way to stop it.

What steps can reproduce the bug?

Uploaded thread: 019b1913-3de2-7551-90df-0481f2546f9e

What is the expected behavior?

No response

Additional information

No response

Icarus603 avatar Dec 13 '25 19:12 Icarus603

Seconding this, hitting escape simply shifts the focus back to whatever other window was last touched. The only workaround I've found is interrupting the run, but then you're left trying to figure out what's been changed.

0377892 avatar Dec 16 '25 16:12 0377892

With the "feat: close unified_exec at end of turn (#8052)" commit in 0.74.0-alpha.1, this issue was addressed but it also affects situations when Codex ends the turn instead of the user. There are situations where I would like a command to continue to run when Codex ends the turn (rather than the user), which was possible prior to this commit. Is this something that will not be supported moving forward?

sudarshan227 avatar Dec 22 '25 20:12 sudarshan227