Problem
finalizeRun unconditionally transitions tasks to review whenever an agentd run is non-running.
Current behavior:
- success =>
review - failed =>
review - timeout =>
review - infrastructure errors (run missing/status failure) =>
review
This conflates successful dev completion with execution failure.
Why this is risky
- Review queue gets polluted with tasks that produced no usable patch
- Automation/humans lose signal about what actually succeeded
- Failed runs may require retry/open/needs-help instead of review
Proposed fix
- Branch on
arsStatus: - success/done ->
review - failed/error/timeout ->
open (with retry policy) or needs-help (after threshold) - Add explicit failure comments with actionable error summaries
- Optionally track retry count for scheduler-level failures
Acceptance criteria
- Failed agentd runs do not transition directly to
review - Task status after finalization reflects actual run outcome