Skip to content

Record a pane's descendants at launch and kill that set on close #44

Open

Description

@nachumi-a2zoperations

Record the pane's descendant set while the agent is alive, then kill that recorded set on close.

The session-group reap tried on PR #43 does not belong in the product:

  • On the macOS daemon, getsid() is 1. A reap that treats session id <= 1 as "no session" does nothing, which is the process that hosts agent panes.
  • The orphan in Orchestration: rejected heartbeats from a stale terminal handle keep being delivered to the run (released dispatch) #5 is a Claude Code tool shell. Those shells call setsid, so they are a different session from the pane. Reaping the pane's session never sees them.
  • Where that reap does fire, it SIGKILLs every group in the session, including the root, before killWithDescendantSweep. That skips the graceful sweep and turns a close into SIGKILL.

Do this instead:

  • While the agent is alive, record the pane's descendant set: the processes it started, including tool shells that have called setsid.
  • On close, kill that recorded set. Before each kill, check the process is still the one that was recorded (start-time identity), so a recycled pid is left alone.
  • A ppid walk at close cannot reach a setsid child after it has been reparented. The set has to be captured while the parent relationship still exists.

Refs #5. This is the process-ownership half of that report. The heartbeat-delivery half is handled separately.


Claimed 2026-11-14 ~01:10 PT by the Orca features plan lane (coordinator run_4fa6b15833ca, worker fork-5). Design first, then a Fable architecture review, then the PR (Fixes #44).

Activity

  1. added 9 commits that reference this issue on Nov 15, 2026
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions