Expand description
Agent-spawned process tracking.
Gives the host a complete, authoritative view of what each agent CLI has forked — backgrounded shells, dev servers, Docker containers, file watchers, nested bash/python/node children, etc. The goal is end-user visibility: a user running multiple agents can see in one place what’s still running on their machine, and kill it reliably when they’re done.
The API is a platform-agnostic trait. Per-platform impls use the strongest available mechanism:
| Platform | Impl | Mechanism | Confidence |
|---|---|---|---|
| Windows | JobObjectTracker | CreateJobObject + AssignProcessToJobObject + TerminateJobObject | high |
| Linux | Cgroupv2Tracker | systemd-run --user --scope + cgroup.procs / cgroup.kill | high |
| macOS | ProcessGroupTracker | POSIX_SPAWN_SETPGROUP + killpg | best-effort |
| other | StubTracker | no-op | none |
The frontend’s swarm panel surfaces the confidence level so users know when tracking may miss escaped descendants.
See agentmux-ai/AGENT_SPAWNED_PROCESSES_SPEC.md for the design.
Modules§
- registry
AgentProcessRegistry— app-wide map from block_id → tracker handle.- stub
- Windows fallback if
JobObjectTracker::newfails (e.g. the process is not elevated enough to create a job object). The real impl lives inwindows; this is only used for the init-fail recovery path. - windows
- Windows
ProcessTreeTrackerimplementation backed by Job Objects.
Structs§
- Tracked
Process - A single process tracked by the host — PID + metadata enriched per-platform. The frontend renders one row per entry.
Enums§
- Tracking
Confidence - How reliable this platform’s tracker is.
Traits§
- Tracker
Handle - Opaque per-agent handle returned by the tracker when we wrap a spawn.
Held inside
AgentProcessRegistryfor the lifetime of the pane; dropped when the pane closes or the agent exits.
Functions§
- new_
tracker - Factory: returns a platform-appropriate tracker handle that will accept the next-spawned process and everything it forks.