Skip to main content

Module roots_file

Module roots_file 

Source
Expand description

srv’s side of agentmux_common::agent_roots: the running agent CLIs, each the leader of its own process group, written to <data_dir>/agent-roots.json so the launcher can end them if srv dies without closing them.

Recorded when an agent CLI is tracked (super::registry::track_spawned_agent), pruned on the registry poller’s tick once a CLI has exited, and deleted by finish at srv’s clean exit when no CLI is left.

Functions§

finish
srv’s clean exit, after every agent was closed: delete the file, or, if a CLI outlived the teardown’s cap, keep it (pruned) for the launcher.
prune
Drop the CLIs that have exited. Called from the registry poller.
record
Record a freshly spawned agent CLI.