Skip to content

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

Closed

Description

@Icarus603

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

Activity

  1. 0377892 commented on Dec 16, 2025

    @0377892

    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.

  2. sudarshan227 commented on Dec 22, 2025

    @sudarshan227

    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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions