Module registry

Module registry 

Source
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§

AgentProcessRegistry
RegistryEntry 🔒

Statics§

GLOBAL 🔒
Host-wide registry, set once at startup. Exposed as a global so SubprocessController / PersistentSubprocessController can reach it without threading an Arc through every constructor + test site. Tests that don’t initialize it see None and 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 Arc refcount hits zero (host shutdown). ~2s cadence balances latency (new processes show up fast) with CPU overhead (job queries are cheap but not free).