pub fn spawn_monitor(
state: &State,
program: &str,
args: &[String],
envs: &[(String, String)],
) -> Result<u32, MonitorError>Expand description
Spawn a background monitor that owns the agent for the given workflow state.
The monitor is a detached shell process that:
- Launches the agent (
program+args) with stdout redirected to the phase stdout file, recording the agent PID to the agent-pid file - Waits for the agent to exit and records its exit code to the exit file
- Runs
devflow advance --phase Nto advance the workflow through its remaining stages
Returns the PID of the spawned monitor.