Skip to main content

Module agent_result

Module agent_result 

Source
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:

  1. Parse DEVFLOW_RESULT from agent stdout (authoritative)
  2. Exit code + commit count gate (reliable fallback)
  3. Process gone + commits exist (last resort warning)

Structs§

AgentResult
Parsed agent completion result.

Enums§

AgentStatus
Agent completion status determined by DevFlow.
ResultError
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_path under .devflow/.
stdout_path
Path to the stdout file for a given phase.