pub fn place_spawn(block_id: &str, cmd: &mut Command, create: bool)Expand description
Make a child about to be spawned for block_id join its tracker before it
execs, so nothing it forks escapes between spawn and track_spawned
(Linux: the agent’s cgroup). create: start the block’s tracker if it has
none (an agent’s own CLI); otherwise join only an existing one (Shell(),
!cmd, like track_adopted). Still call track_spawned* /
track_adopted after the spawn: that records the PID and covers platforms
with no pre-exec placement.
An agent’s own CLI (create) also leads its own process group on Unix,
so a signal to its group (its own, or one of its tools’) can’t reach srv,
and its teardown (process::kill_child_and_group) takes its MCP servers
too. The launcher finds these groups through agent_roots if srv dies
without closing them.