Skip to content

Linux sandbox: killing a command's process group leaves the sandboxed process running (orphaned under init) #61647

Open

Description

@goldmar

codex-cli 0.169.0, Linux, bubblewrap sandbox.

Repro

codex sandbox -- sleep 400 &
ps -eo pid,ppid,pgid,sid,comm | grep -E 'codex|bwrap|sleep'
#   codex (pgid A) -> bwrap (pgid A) -> codex-linux-sandbox (new session, pgid B) -> sleep (pgid B)
kill -TERM -A        # what Codex does to stop a command / background terminal
# bwrap and the outer codex are gone; codex-linux-sandbox (now ppid 1) and sleep keep running.

Same with SIGKILL. In app-server this happens on turn interrupt + thread/backgroundTerminals/terminate, and when the app-server exits: the user's command keeps running after Codex reports it stopped.

Expected: stopping a command stops the whole sandboxed process tree — for example by also killing the inner session or PID namespace, or by making --die-with-parent effective for the --as-pid-1 child.

Activity

  1. added
    bug
    CLI
    sandbox
    app-server
    on Nov 15, 2026
  2. github-actions commented on Nov 15, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

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

    CLIapp-serverbugsandbox

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions