Skip to main content

Module scan

Module scan 

Source
Expand description

Finding an agent’s processes in the process table, by the env tag they inherit. Two uses:

  • tagged, on every OS: after a teardown, what still carries the tag got out of the agent’s tracker, and is reported (agent_teardown).
  • ScanTracker: the best-effort tracker where the OS can’t hold the tree: macOS (no cgroups), Linux without a delegated cgroup, and Windows when a Job Object can’t be created.

An agent’s processes are:

  • every descendant of the processes assigned to it (its CLI), and
  • every process carrying its AGENTMUX_BLOCKID in its environment, which whatever the agent starts inherits, setsid daemons and orphans reparented to init or launchd included, plus their descendants.

A process that cleared its environment after leaving the tree is missed; hence BestEffort. See docs/analysis/agent-spawned-process-tracking-2026-10-07.md §6.3.

Structs§

ScanTracker
One agent’s best-effort tracker.

Functions§

block_tag
The env entry that marks a block’s processes.
tagged
Every live process tagged with block_id (and its descendants), from a fresh scan. What a teardown reports as having escaped its tracker.