pub fn own_instance_pids(nodes: &[ProcNode], self_pid: u32) -> HashSet<u32>Expand description
The pids of the instance self_pid (srv) belongs to: the topmost agentmux*
ancestor reached by walking up from srv (the launcher; srv itself when its
parent isn’t AgentMux, as when it is run by hand), and every process below
it. The walk stops at the first parent that isn’t agentmux*, so the
terminal, task or AppImageLauncher that started the instance is not part
of it. Empty when self_pid isn’t in the table.
Another AgentMux started from inside this one, say an agent running
task dev in a pane’s shell, is below this instance’s root too, but it is
its own instance: an agentmux* process whose parent is not agentmux*
is a launcher, so it and everything under it are left out.
The table’s parent links can be stale (a parent that exited and whose pid was reused), so the upward walk is bounded by the table’s size and a seen set rather than trusted to end.