Skip to main content

Module monitor

Module monitor 

Source
Expand description

Background monitor daemon.

Spawns a detached child process that owns the coding agent: it launches the agent, captures its stdout and exit code into .devflow/, and — when the agent exits — runs devflow advance to advance the stage machine.

Owning the agent is the key fix over a CLI-scoped capture thread: because the monitor outlives devflow start, the agent’s stdout keeps flowing into the capture file and its exit code is still reaped after the CLI exits.

This is the core automation primitive — no cron, no scheduler, no agent cooperation needed.

Enums§

MonitorError
Errors produced by monitor operations.

Functions§

spawn_monitor
Spawn a background monitor that owns the agent for the given workflow state.
wait_for_agent_pid
Poll for the agent PID that the monitor records, for up to ~1 second.