Repository navigation
fix(runners): treat claude is_error / non-zero exit as a failed run - #128
Conversation
…-run spend - claude max-turns responses carry no result text; use errors[] and the subtype in the error message. - runStep/runLoop record and charge the cost a failed run reports, so a loop of failing claude runs can't blow through the budget.
…d loop iterations runParallel dropped the spend of failed children (including all-failed dispatches), and runLoop didn't charge iterations that failed their require: check, so overBudget under-counted and loops could overspend.
🔍 REVIEW — automated merge-readinessReview only — a verdict on this PR; no code was changed. Corrections, when applied, arrive as a separate
Reviewed head: Both findings survive repository and merge-base inspection:
These are static code-path confirmations; runtime tests were not executed under the read-only filesystem restriction. VERDICT: CHANGES_REQUESTED - failed-loop edits can be committed, and the new parallel test races Automated pre-merge review by |
…er test race-free
🔍 REVIEW — automated merge-readinessReview only — a verdict on this PR; no code was changed. Corrections, when applied, arrive as a separate
Reviewed head: One blocking finding survives; the repository does not support refuting it.
Validation was by source tracing and base comparison. Runtime reproduction was unavailable under the read-only filesystem restriction. VERDICT: CHANGES_REQUESTED - failed-loop rollback deletes earlier successful work Automated pre-merge review by |
🔍 REVIEW — automated merge-readinessReview only — a verdict on this PR; no code was changed. Corrections, when applied, arrive as a separate
Reviewed head: Previous finding — fixed. The checkpoint preserves preceding steps’ work before rollback. One new blocker:
Reviewed the entire PR diff and affected call paths. Validation was by source tracing and base comparison; tests were not run under the read-only filesystem restriction. CI status supplied: none. The rollback correction and its checkpoint follow-up have now each introduced a workflow regression, meeting the requested human-escalation threshold. VERDICT: NEEDS_HUMAN - repeated corrections still leave a repair-loop regression Automated pre-merge review by |
…ead of a checkpoint commit
🔍 REVIEW — automated merge-readinessReview only — a verdict on this PR; no code was changed. Corrections, when applied, arrive as a separate
Reviewed head: Previous findings:
Reviewed the entire base-to-head diff and affected call paths, with particular attention to changes since CI is GREEN as supplied. Tests were inspected but not rerun because the filesystem is read-only. The supplied review history already meets your threshold of two failed correction cycles, requiring human sign-off despite the fixes above. VERDICT: NEEDS_HUMAN - two prior correction cycles failed Automated pre-merge review by |
Cause
ClaudeRunner.Run(src/runners/claude.go) parsedis_errorand the exit code fromclaude -p --output-format jsonbut never checked them. A rate limit, auth failure or--max-turnsexhaustion came back as a nil error, so the engine marked the stepkeptand fed the error text into later{{step}}prompts. Codex and Gemini runners already fail on a non-zero exit.Fix
is_erroris true or the exit code is non-zero. Output, cost and exit code stay on the result.result; the error message falls back toerrors[], then stderr, and is prefixed withsubtype.runStep/runLooprecord and charge the cost a failed run reports, so a loop of failing runs still hits the budget cap (this was implicitly counted before, when failures looked like successes).Tests
claude_run_test.go: fakeclaudeon PATH coveringis_error, non-zero exit with valid JSON, success, and max-turnserrors[].TestRunWorkflowFailedRunsCountTowardBudget.