Skip to content

runner: a sandboxed tty: true command terminated during its sandbox setup can keep running (Linux) #119

Open

Description

@novelKR

What happens

On Linux, terminating a sandboxed tty: true process, or its timeout, signals the PTY root's process group. bubblewrap's sandbox process, the first process of the sandbox's PID namespace, is in that group until it starts a session of its own, which it does only shortly before it sets its parent-death signal (--die-with-parent). A kill that lands between those two steps leaves that process running without its parent, and with it the command it then starts, which keeps the PTY open until it ends on its own.

This is the tty: true form of #109. #118 fixed the pipe form, whose window was the whole sandbox setup; this window is much narrower, but it is not closed.

Why #118 does not cover it

#118 ends a sandboxed pipe process by stopping, then killing, every process below its root, which it finds through /proc from the root's process ID. For a PTY process the Runner does not know that ID: the pinned Codex PTY handle (codex-utils-pty's ProcessHandle) keeps it to itself and offers only its own terminate.

Fix direction

Give the Runner the PTY root's process ID, then end a sandboxed tty: true root the way #118 ends a pipe root, with a test that terminates a tty: true process during sandbox setup. Exposing the ID from the Codex PTY means a change to the recorded Codex patch, which needs the owner's approval; finding it without a Codex change is to be checked first.

Scope

The Linux sandbox (bubblewrap) with tty: true only.

Activity

  1. self-assigned this
    on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions