Expand description
AgentProcessRegistry — app-wide map from block_id → tracker handle.
Created once at host startup, passed into each SubprocessController
/ PersistentSubprocessController instance so it can wrap spawns
in its per-block job. Polled periodically from a background task
that emits agent:process-added / agent:process-exited events to
the frontend’s swarm activity panel.
Centralizing this here (rather than one tracker per controller) means the lifetime of the tracker matches the lifetime of the pane — multiple turns on the same block share the same job, so descendants from turn N are still visible on turn N+1.
Structs§
Statics§
- GLOBAL 🔒
- Host-wide registry, set once at startup. Exposed as a global so
SubprocessController/PersistentSubprocessControllercan reach it without threading anArcthrough every constructor + test site. Tests that don’t initialize it seeNoneand silently skip tracker registration — the job-object spawn path no-ops cleanly.
Functions§
- global
- set_
global - spawn_
poller - Spawn the polling task. Drops when the registry’s
Arcrefcount hits zero (host shutdown). ~2s cadence balances latency (new processes show up fast) with CPU overhead (job queries are cheap but not free).