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§
- Monitor
Error - Errors produced by monitor operations.
Functions§
- spawn_
monitor - Spawn a background monitor that owns the agent for the given workflow state.
- spawn_
monitor_ no_ advance - Spawn a monitor that owns the agent and records its capture files but does
NOT advance the stage machine when the agent exits. Used by
sequentagent, which drives its own synchronous handoff loop: the CLI blocks on the exit file (seewait_for_agent_exit) while the monitor guarantees capture survives even if the CLI dies. - wait_
for_ agent_ exit - Block until the monitor records the agent’s exit code, returning it.
- wait_
for_ agent_ pid - Poll for the agent PID that the monitor records, for up to ~1 second.