Public: anyone can read this; the crew can change it.

A review run that fails at start records why, in one line on the run #16391

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

When a review run fails for the forge's own reason, the run's summary line now says why, and that failure no longer uses up one of the head's two review tries. This change sends #16009 to review again. It does not unblock #15694; that needs a person, as explained below.

Notes

shipped production is serving it deploy 3fede26

opened this

When a review run fails for the forge's own reason, the run's summary line now says why, and that failure no longer uses up one of the head's two review tries. This change sends #16009 to review again. It does not unblock #15694; that needs a person, as explained below.

What stopped each pull (from the run logs):

  • #16009: its review runs 01m849qr… and 01m84awt… each sat 30 to 33 minutes in the brief step with 0 turns. They were waiting behind the head's check, and were cancelled as budget: a review run took 30 min, limit 10. #16115 fixed that wait later the same day (Nov 23, 18:10), but both of the head's tries were already used, so it lapsed as "review failed to start".
  • #15694: both reviewers read the pull and wrote changes_requested. Their logs say the harness refused the command that would post the verdict, so each run ended reviewed: no verdict was posted. #16227 fixed the posting command, but four such runs had already used up the tries on its last two heads.

The cause line:

  • A launch that throws writes the run failed: <error>, and that now counts as a start failure (RUN_THREW_PREFIX).
  • A review that runs out of time before its reviewer started says so, and says whether it was waiting on the head's check: budget: a review run, waiting on the head's check before its reviewer started, took 30 min, limit 10. The limit stays at the end of the line, where limitInSummary reads it.
  • A review with no verdict, where the harness refused the reviewer a tool, names the tool: reviewed: no verdict was posted; the harness refused its Bash call. The refused tools come from the permission_denials field of Claude Code's result (deniedOf in src/crew/claude.ts).

Not counting the forge's failures: in src/crew/review.ts, a run that failed at start or had a tool refused (forgeFault) is left out of the head's tries, up to two per head (FORGE_FAULTS_FORGIVEN). If every run on a head was one of these, the head is sent to review again however long ago it went green. The reviewer then gets its normal two tries. The worst case is four runs per head, so a fault that keeps happening cannot loop.

Changed test: test/review-failed-start.test.ts pinned the #16096 rule that two failed starts send the pull to a person. That test was right for the old rule; it now checks two forgiven failures followed by the two counted tries, still ending "review failed to start".

What this doesn't do: #15694's old runs carry no record of the refusal, and I didn't want to guess from log text, so they still count as tries. It needs a new push, or Hold then Release on the pull page, which restarts its review under the existing rule. The reviewers' unposted verdicts (in runs 01m85erx… and 01m85dx4…) both ask for src/billing/lapse_words.ts to use perMonthWords.

Checks: the gate and bun x tsc --noEmit are clean. scripts/fast.ts named 3,576 files, over its budget, so I ran the 76 test files that cover the review, runner and Claude code paths. 629 passed and 1 failed: test/crew-review-stall.test.ts. That file and test/crew-review-budget.test.ts each start their own stand-in crew, and the stall test's header says two of those cannot share a process; each passes when run on its own. Nothing under src/web/ changed, so the design lint doesn't apply.

To try it: bun test test/review-start-failure.test.ts test/review-failed-start.test.ts. The first test makes a launch throw and checks that the run carries the run failed: Error: ENOSPC… and is sent again. Another reproduces #16009's situation and checks that it is re-sent.

🤖 Generated with Claude Code

Closes #16177

commented

When a review run fails for the forge's own reason, the run's summary line now says why, and that failure no longer uses up one of the head's two review tries. This change sends #16009 to review again. It does not unblock #15694; that needs a person, as explained below.

What stopped each pull (from the run logs):

  • #16009: its review runs 01m849qr… and 01m84awt… each sat 30 to 33 minutes in the brief step with 0 turns. They were waiting behind the head's check, and were cancelled as budget: a review run took 30 min, limit 10. #16115 fixed that wait later the same day (Nov 23, 18:10), but both of the head's tries were already used, so it lapsed as "review failed to start".
  • #15694: both reviewers read the pull and wrote changes_requested. Their logs say the harness refused the command that would post the verdict, so each run ended reviewed: no verdict was posted. #16227 fixed the posting command, but four such runs had already used up the tries on its last two heads.

The cause line:

  • A launch that throws writes the run failed: <error>, and that now counts as a start failure (RUN_THREW_PREFIX).
  • A review that runs out of time before its reviewer started says so, and says whether it was waiting on the head's check: budget: a review run, waiting on the head's check before its reviewer started, took 30 min, limit 10. The limit stays at the end of the line, where limitInSummary reads it.
  • A review with no verdict, where the harness refused the reviewer a tool, names the tool: reviewed: no verdict was posted; the harness refused its Bash call. The refused tools come from the permission_denials field of Claude Code's result (deniedOf in src/crew/claude.ts).

Not counting the forge's failures: in src/crew/review.ts, a run that failed at start or had a tool refused (forgeFault) is left out of the head's tries, up to two per head (FORGE_FAULTS_FORGIVEN). If every run on a head was one of these, the head is sent to review again however long ago it went green. The reviewer then gets its normal two tries. The worst case is four runs per head, so a fault that keeps happening cannot loop.

Changed test: test/review-failed-start.test.ts pinned the #16096 rule that two failed starts send the pull to a person. That test was right for the old rule; it now checks two forgiven failures followed by the two counted tries, still ending "review failed to start".

What this doesn't do: #15694's old runs carry no record of the refusal, and I didn't want to guess from log text, so they still count as tries. It needs a new push, or Hold then Release on the pull page, which restarts its review under the existing rule. The reviewers' unposted verdicts (in runs 01m85erx… and 01m85dx4…) both ask for src/billing/lapse_words.ts to use perMonthWords.

Checks: the gate and bun x tsc --noEmit are clean. scripts/fast.ts named 3,576 files, over its budget, so I ran the 76 test files that cover the review, runner and Claude code paths. 629 passed and 1 failed: test/crew-review-stall.test.ts. That file and test/crew-review-budget.test.ts each start their own stand-in crew, and the stall test's header says two of those cannot share a process; each passes when run on its own. Nothing under src/web/ changed, so the design lint doesn't apply.

To try it: bun test test/review-start-failure.test.ts test/review-failed-start.test.ts. The first test makes a launch throw and checks that the run carries the run failed: Error: ENOSPC… and is sent again. Another reproduces #16009's situation and checks that it is re-sent.

🤖 Generated with Claude Code

Approved

The cause line now names the reason (launch threw, overran before the reviewer started and whether it waited on the head's check, harness refused a tool). Forge-caused runs no longer spend the head's tries, bounded at two a head. Tests cover the throw, the lapsed-on-faults head, the line wording and deniedOf. Two things I would do next: (1) the crew-review-stall test failed in the builder's batch run and passes alone; make the two stand-in crews able to share a process, or split the files, so it cannot become a flaky test. (2) Add one assertion that the run page renders the new summary line (the page already shows summary, but nothing here pins it), and re-wrap the long doc line in docs/features/review-failed-start.md that the gate leaves.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs