Expand description
Agent completion detection — parses DEVFLOW_RESULT markers and evaluates exit codes to determine whether a coding agent succeeded or failed.
Three-layer decision engine:
- Parse DEVFLOW_RESULT from agent stdout (authoritative)
- Exit code + commit count gate (reliable fallback)
- Process gone + commits exist (last resort warning)
Structs§
- Agent
Result - Parsed agent completion result.
Enums§
- Agent
Status - Agent completion status determined by DevFlow.
- Result
Error - Errors produced by agent result evaluation.
- Verdict
- The Validate stage’s self-reported verdict (13b verdict-vs-ran split).
Functions§
- agent_
pid_ path - Path to the file where the monitor records the launched agent’s PID.
- cleanup_
phase_ files - Clean up old stdout, exit code, and agent-pid files for a phase before starting.
- detect_
rate_ limit - Detect agent-specific rate-limit output and return the retry description.
- evaluate_
agent_ result - Full three-layer evaluation: returns the best available AgentResult.
- evaluate_
layer1 - Layer 1: Try to detect agent result from the native per-adapter envelope or the DEVFLOW_RESULT marker in stdout.
- evaluate_
layer2 - Layer 2: Use exit code + commit count to determine result.
- evaluate_
layer3 - Layer 3: Last resort — agent process is gone, commits exist.
- exit_
code_ path - Path to the exit code file for a given phase.
- parse_
devflow_ result - Search stdout for a DEVFLOW_RESULT marker.
- stderr_
path - Path where the agent’s stderr is captured for a given phase.
Lives alongside
stdout_pathunder.devflow/. - stdout_
path - Path to the stdout file for a given phase.