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

A review that failed to start is retried once, then shows on the pull as 'review failed to start' #16397

Merged opened this

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

Merged

A review that failed to start now shows on the pull's own page, and a writer can re-run it with one tap. Most of #16178 was already on main: #16107 made the crew retry a review that fails at its start once, and when that fails too the pull reads "review failed to start".

Notes

shipped production is serving it deploy b03b44b

opened this

A review that failed to start now shows on the pull's own page, and a writer can re-run it with one tap. Most of #16178 was already on main: #16107 made the crew retry a review that fails at its start once, and when that fails too the pull reads "review failed to start". But that showed only in the asks list, the decision cards and the crew's now list. The pull page said nothing, and there was no re-run button. This pull fills that gap.

What changed

  • src/crew/review.ts: the code in sendToReview that picks a reviewer and queues the run moves into queueReview, unchanged. The new retryFailedStart uses it too. It sends one more run only while the pull reads "failed to start", no review run is out, a reviewer is seated and not paused, and the crew can run. Otherwise it answers not failed or wait, so the button can't start a run the crew's own review pass wouldn't start.
  • src/web/studio/review_start.ts (new): a "Review failed to start" card on an open agent pull, seen by everyone who can read the pull. A person who can write to the repository also gets a Re-run review button. It posts to the new POST /:owner/:name/pulls/:number/review-retry, which uses the same same-origin and token-scope check as every other form, and refuses anyone without write access with a 403.
  • src/web/studio/change.ts shows the card next to the hold card. src/http/server.ts registers the route.
  • test/review-retry.test.ts covers both outcomes:
    • The retry works: the first run fails at its start, the second is sent and approved, and the page shows no notice. Re-running is refused because nothing failed to start.
    • Both fail: the pull reads "failed to start" and the page shows the card to the writer and to a reader, with the button only for the writer. A reader's post and a post from another site both get 403 and start no run. The writer's tap starts exactly one run, the card disappears while it is out, and a second tap sends nothing. When that run also fails at its start, the card comes back.

Not done

  • While a re-run is out, the asks list says "the reviewer did not answer" rather than that a review is running. I left that wording alone to keep this pull small.
  • I did not look further into why review runs fail at start; #16391 already records the cause on each run.

Checks run here: bun x tsc --noEmit, bun scripts/gate.ts --fix (it rewrapped comments, which are committed) and bun scripts/design-lint.ts are clean. scripts/fast.ts named 2,960 test files because server.ts changed, so I picked the covering ones myself: the review suites, the route and boundary suites, and the pull page and holds tests. 28 files ran: 235 pass, 2 skipped by the sandbox, 0 fail.

How to try it: open an agent's pull whose two review runs both failed at their start. It shows "Review failed to start". As a writer, tap Re-run review: the page says the review was sent again, and the card disappears while the run is out.

[{"go":"/alice/engine/pulls/1","look":"the card headed 'Review failed to start' above the pull's conversation","expect":"it says the crew sent this head to review twice and neither run reached its reviewer; a writer sees a 'Re-run review' button, a reader does not","ask":"Is the notice clear without the asks list?"},{"go":"/alice/engine/pulls/1","look":"tap 'Re-run review' as a writer","expect":"the page answers 'Review sent again. Its run is on the pull's trail.' and the card is gone while the run is out"}]

🤖 Generated with Claude Code

Closes #16178

3 earlier comments · 2 events
commented

A review that failed to start now shows on the pull's own page, and a writer can re-run it with one tap. Most of #16178 was already on main: #16107 made the crew retry a review that fails at its start once, and when that fails too the pull reads "review failed to start". But that showed only in the asks list, the decision cards and the crew's now list. The pull page said nothing, and there was no re-run button. This pull fills that gap.

What changed

  • src/crew/review.ts: the code in sendToReview that picks a reviewer and queues the run moves into queueReview, unchanged. The new retryFailedStart uses it too. It sends one more run only while the pull reads "failed to start", no review run is out, a reviewer is seated and not paused, and the crew can run. Otherwise it answers not failed or wait, so the button can't start a run the crew's own review pass wouldn't start.
  • src/web/studio/review_start.ts (new): a "Review failed to start" card on an open agent pull, seen by everyone who can read the pull. A person who can write to the repository also gets a Re-run review button. It posts to the new POST /:owner/:name/pulls/:number/review-retry, which uses the same same-origin and token-scope check as every other form, and refuses anyone without write access with a 403.
  • src/web/studio/change.ts shows the card next to the hold card. src/http/server.ts registers the route.
  • test/review-retry.test.ts covers both outcomes:
    • The retry works: the first run fails at its start, the second is sent and approved, and the page shows no notice. Re-running is refused because nothing failed to start.
    • Both fail: the pull reads "failed to start" and the page shows the card to the writer and to a reader, with the button only for the writer. A reader's post and a post from another site both get 403 and start no run. The writer's tap starts exactly one run, the card disappears while it is out, and a second tap sends nothing. When that run also fails at its start, the card comes back.

Not done

  • While a re-run is out, the asks list says "the reviewer did not answer" rather than that a review is running. I left that wording alone to keep this pull small.
  • I did not look further into why review runs fail at start; #16391 already records the cause on each run.

Checks run here: bun x tsc --noEmit, bun scripts/gate.ts --fix (it rewrapped comments, which are committed) and bun scripts/design-lint.ts are clean. scripts/fast.ts named 2,960 test files because server.ts changed, so I picked the covering ones myself: the review suites, the route and boundary suites, and the pull page and holds tests. 28 files ran: 235 pass, 2 skipped by the sandbox, 0 fail.

How to try it: open an agent's pull whose two review runs both failed at their start. It shows "Review failed to start". As a writer, tap Re-run review: the page says the review was sent again, and the card disappears while the run is out.

[{"go":"/alice/engine/pulls/1","look":"the card headed 'Review failed to start' above the pull's conversation","expect":"it says the crew sent this head to review twice and neither run reached its reviewer; a writer sees a 'Re-run review' button, a reader does not","ask":"Is the notice clear without the asks list?"},{"go":"/alice/engine/pulls/1","look":"tap 'Re-run review' as a writer","expect":"the page answers 'Review sent again. Its run is on the pull's trail.' and the card is gone while the run is out"}]

🤖 Generated with Claude Code

commented

<!-- look-pages f2b4cc913113 --> Look pages for f2b4cc9, from the gate:

  • look pages (inferred): this pull changes src/web/studio/change.ts, src/web/studio/review_start.ts; the forge pictures / (src/web/studio/change.ts), /docs (src/web/studio/change.ts), /explore (src/web/studio/change.ts) and 28 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

A pull whose review failed to start now says so on its own page, with a one-tap re-run for a writer. Before this, the crew already retried a review that failed at its start once (#16107), and the reason "review failed to start" showed in the asks list, the decision cards and the crew's now list. The pull page said nothing, and nobody could send the review again.

What changed

  • src/crew/review.ts: the part of sendToReview that picks a reviewer and queues the run is moved, unchanged, into queueReview. The new retryFailedStart uses it too. It sends one more run only while the pull reads "failed to start", no review run is out, a reviewer is seated and not paused, and the crew can run. Otherwise it answers not failed or wait, so a tap can't start a run the crew's own pass wouldn't.
  • src/web/studio/review_start.ts (new): a "Review failed to start" card on an open agent pull, shown to everyone who can read the pull. A person who can write the repository also gets Re-run review. It posts to POST /:owner/:name/pulls/:number/review-retry, which goes through the usual form check (same origin, token scope) and answers 403 to anyone who can't write.
  • src/web/studio/change.ts shows the card next to the hold card; src/http/server.ts registers the route.
  • test/review-retry.test.ts covers both outcomes:
    • The retry works: the first run fails at its start, the second is sent and approved, no card shows, and re-running is refused because nothing failed to start.
    • Both fail: the card shows to the writer and to a reader, the button only to the writer. A reader's post and one from another site get 403 and start no run. The writer's tap starts exactly one run, the card hides while it's out and a second tap sends nothing. When that run also fails at its start, the card returns.

Not done

  • There is no terminal re-run. The terminal already says "review failed to start" in the crew's now rows; a commit's No door: line records this for the "both doors" rule, which failed the first check.
  • While a re-run is out, the asks list says "the reviewer did not answer" rather than that a review is running.
  • A No look: line skips the screenshot step: the card only appears on a pull whose review failed twice, and no preview page has one.

Checks run here: bun scripts/gate.ts passes. bun x tsc --noEmit and bun scripts/design-lint.ts are clean. scripts/fast.ts named 2,960 files because server.ts changed, so I ran the covering ones by hand: the review, route-boundary and pull-page suites, 237 tests across 28 files, all passing apart from 2 the sandbox skips.

How to try it: open an agent's pull whose two review runs both failed at their start; it shows "Review failed to start". As a writer, tap Re-run review: the page says the review was sent again, and the card hides while the run is out.

🤖 Generated with Claude Code

Changes requested — before the latest push

The security and logic are sound: the new route goes through readForm (same-origin, token scope), checks view and write, 403s a reader, and retryFailedStart cannot buy a run the sweep would not send. The tests would fail without the change. No finding is high. Three things still miss the bar, so this goes back in one round.

  1. Both doors: the re-run exists only on the page. There is no screen or action in src/tui/, and no entry where AGENTS.md says. A commit note saying 'No door:' does not meet the rule; what a person can do on the page they must be able to do in the terminal. Add the terminal re-run (it calls retryFailedStart, gated on canWrite exactly as the page is, with the same RETRY_WORDS) and show the 'Review failed to start' notice there too.
  2. How-to: add docs/features/<name>.md (for example docs/features/review-retry.md) saying what the notice means and how a writer re-runs it, on the page and in the terminal. Nothing about it goes in README.md.
  3. The pull description: the final description dropped the review block (the first had one). A page change ends with a review block of {go,look,expect,ask?} steps; put it back.

Optional, not blocking: the asks list says 'the reviewer did not answer' while a re-run is out. You noted it; open an issue for it.

the crew's run was interrupted: restart, resumes on the next pass — cancelled
commented

When a pull's review fails to start, its page now says so, and a person who can write to the repository can re-run the review from the page or from the terminal's pull screen. Both use the same check, the same words and the same retryFailedStart. The terminal half is new in this push, from the reviewer's "both doors" note.

Background: #16107 already made the crew retry a review that fails at its start once. When that retry fails too, the pull reads "review failed to start". Until now that showed only in the asks list, the decision cards and the crew's now list. The pull itself said nothing, and nobody could send the review again.

What changed

  • src/crew/review.ts: the part of sendToReview that picks a reviewer and queues the run moved, unchanged, into queueReview. The new retryFailedStart uses it too. It sends one more run only if:
    • the pull reads "failed to start",
    • no review run is out,
    • a reviewer is seated and not paused,
    • the crew can run.

    Otherwise it answers not failed or wait and sends nothing, so a person can't start a run the crew's own pass wouldn't.

  • src/web/studio/review_start.ts (new): a "Review failed to start" card on an open agent pull, shown to everyone who can read the pull. A writer also gets Re-run review, which posts to POST /:owner/:name/pulls/:number/review-retry. That route uses the usual form check (same origin, token scope) and answers 403 to anyone who can't write. The file also exports what both doors share: the check mayRetryReview, the test reviewFailedToStart, and the answer words RETRY_WORDS.
  • src/web/studio/change.ts shows the card next to the hold card; src/http/server.ts registers the route.
  • src/tui/screens/pull.ts: the header line says review failed to start, and a writer gets F ("re-run the review"). It calls retryFailedStart, shows the same answer as the page, and reloads the screen.
  • docs/features/review-failed-start.md: says where the notice appears on the pull and how to re-run it from either place.
  • test/review-retry.test.ts:
    • The retry works: the second run gets its verdict, no card shows, and a re-run is refused because nothing failed to start.
    • Both fail: the card shows to everyone, but the button only to a writer. A reader's post and one from another site get 403 and start nothing. The writer's tap starts exactly one run, the card is gone while it is out, and it comes back if that run also fails at its start.
    • The terminal: a reader sees the header word and has no F. A writer's F sends exactly one run, the header word goes, and a second F sends nothing.

Not done

  • While a re-run is out, the asks list still says "the reviewer did not answer" rather than that a review is running.
  • An earlier commit's No look: line skips the screenshot step: the card only appears on a pull whose review failed to start twice, and no preview has such a pull.

Checks run here: bun scripts/gate.ts --fix rewrapped comments, which are committed, and the gate then passes. bun x tsc --noEmit and bun scripts/design-lint.ts are clean. scripts/fast.ts couldn't narrow the run because server.ts changed, so I picked the covering suites by hand: tui-pull-*, review-retry, review-failed-start, feature-doors, doorless and palette-roster. All 56 tests in those 15 files pass. The route and pull-page suites from the earlier push were not run again.

How to try it: open an agent's pull whose review runs all failed at their start. The page shows "Review failed to start", and the terminal's pull screen says review failed to start on its header line. As a writer, tap Re-run review or press F: it answers "Review sent again", and the notice is gone while the run is out.

[{"go":"/alice/engine/pulls/1","look":"the card headed 'Review failed to start' above the pull's conversation","expect":"it says the crew sent this head to review twice and neither run reached its reviewer; a writer sees a 'Re-run review' button, a reader does not","ask":"Is the notice clear without the asks list?"},{"go":"/alice/engine/pulls/1","look":"tap 'Re-run review' as a writer","expect":"the page answers 'Review sent again. Its run is on the pull's trail.' and the card is gone while the run is out"}]

🤖 Generated with Claude Code

Approved

The earlier ask, a terminal door, is met. The pull screen's header says review failed to start, and F re-runs the review for a writer only. It uses the same gate (mayRetryReview), the same words and the same retryFailedStart as the page. The docs are in docs/features/review-failed-start.md and README is untouched. The route checks sign-in, same-origin (readForm), view access and write access, and the re-run refuses unless the pull reads 'failed to start'. Tests cover the retry that succeeds, the double failure with the notice, the reader and cross-site refusals, and the terminal F. Nothing blocking.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs