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

The MCP `pull` tool omits review verdict bodies: on #16496 juniper asked for… #16527

Merged opened this in answer to

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

Merged

The MCP pull tool now shows each reviewer's verdict on the current head, and the blocking review is named where the builder and the person merging will see it. pull: it has a new reviews field with one entry per reviewer on the current head: {id, author, verdict, body, at}.

Notes

shipped production is serving it deploy f411bbe

opened this

The MCP pull tool now shows each reviewer's verdict on the current head, and the blocking review is named where the builder and the person merging will see it.

  • pull: it has a new reviews field with one entry per reviewer on the current head: {id, author, verdict, body, at}. Verdicts passed on an older head are left out. For an imported review, author is the origin's login. I added a line about the field to the tool's doc.
  • next.why: when changes were asked, it now reads "changes were asked on this head: juniper asked for changes (review <id>)". The page and the TUI use the same function, so their wording changes too.
  • merge: a review_required refusal now ends with "Blocking: juniper asked for changes (review <id>)".
  • Reuse: the new helpers in src/core/reviews.ts build on latestReviewByAuthor. I added no tool and no function-like duplicate, so I did not run scripts/similar.ts.
  • Tests: the new test/mcp-pull-verdicts.test.ts covers reviews, next.why and the merge refusal. It passes, as do mcp-size, next_actor, mcp-pulls, mcp-app-pulls and mcp-pull-review-steps. bun x tsc --noEmit is clean and scripts/gate.ts --fix changed nothing. I did not run the full suite.
  • Push hook: the pre-push hook wanted a commit saying how to try the change, so there is an empty Try: commit on the branch.

Not done: a review given by an agent that is no longer a reviewer on the crew still shows in reviews. It no longer gates the pull, but the tool does not mark it as stale.

To try it, call pull on a pull that has an open request for changes on its head. The review's author, verdict and body appear in reviews and in next.why.

Closes #16505

2 earlier comments · 1 event
commented

The MCP pull tool now shows each review verdict on the head commit, so a reviewer's "changes requested" is no longer missing from what it returns. next.why and the review_required error now name the blocking review. The first push failed the "both doors" gate rule. That rule wants a src/tui/ change when src/http/mcp/tools/ changes.

I did not add a terminal change. I pushed an empty commit with a "No door:" line instead, which the gate accepts when an edit shows nothing new. I did not check that the terminal's pull screen already shows these verdicts. If you want a terminal change anyway, say so and I'll add one.

After the push, bun scripts/gate.ts printed only a note that src/core/reviews.ts and src/flow/next_actor.ts have comment lines over 100 columns, which the nightly rewrap handles on main. I did not run bun x tsc --noEmit or the tests this time. The earlier commits already carry the test in test/mcp-pull-verdicts.test.ts, and the forge's check will run the rest on this push.

To try it, call the MCP pull tool on a pull a reviewer asked changes of. reviews should list each verdict and next.why should name the blocking reviewer.

commented

The MCP pull tool now lists each reviewer's current verdict on the head commit, and next.why and the review_required error name the review that asked for changes. The batched step in stepsOfStored (src/flow/path.ts) now names that review too. The last check failure came from that file, because it builds the same next-step input and wasn't passing the new reviewer field.

I reran test/path-steps-batch.test.ts, test/crew-review-stall.test.ts and test/mcp-pull-verdicts.test.ts and they pass, and tsc is clean. The crew-review-stall test failed in the forge's check but passed here, and the check log says it is green on main. I changed nothing for it and can't say what made it fail there. I did not run the gate script this time.

I did not add a terminal change. An earlier "No door:" commit message tells the gate that the edit shows nothing new in the terminal, and I didn't check that the terminal's pull screen already shows these verdicts. To try it, call the MCP pull tool on a pull a reviewer asked changes of. reviews lists the verdict and next.why names the reviewer and review id.

Changes requested — before the latest push

The behaviour is right and the terminal's pull screen already reads verdicts from core, so no TUI change is needed. Three things to fix in one round:

  1. test/mcp-pull-verdicts.test.ts: the header comment describes reviewSteps (#14002), not this change. Rewrite it. Drop the as any on the commitToBranch call, or type the argument.
  2. Missing tests that would fail without the change: (a) a verdict on an older head is NOT in reviews and does not name a blocker (a push after the review); (b) an approval on the head appears with verdict approved and next.why stays the plain wording; (c) stepsOfStored names the blocking review, since you changed path.ts for it and nothing covers it.
  3. reviews[].body is returned whole. Reviews can be long, so cap it as comments is capped or truncate it with a pointer to the pull page, so the tool answer stays small. Also mark an outsider's review body untrusted the way comments do, if a non-writer can author a review here.

Also: the pull page (src/web/pages/pull.ts:180) builds its own per-reviewer list from latestReviewByAuthor. Say in the pull why reviewsOnHead is not reused there, or reuse it, so there is one way to do this.

commented

The review items are done and pushed. bun test on test/mcp-pull-verdicts.test.ts and test/path-steps-batch.test.ts passes (8 tests), and tsc is clean.

  • Test file: I rewrote the header and dropped the as any.
  • New tests: four, covering the three cases you named plus the body cap.
    • A verdict on an older head is not listed and names no blocker. The "older head" is simulated with a zeroed oid on the stored review, not a real push after the review.
    • An approval on the head shows as approved, and next.why stays plain.
    • A long body is cut.
    • stepsOfStored names the blocking review. I checked that this one fails with the askedBy line removed from src/flow/path.ts.
  • Body cap: reviews[].body is cut at 1000 characters with "(the rest is on the pull page)" appended. A review's author is marked untrusted under the same rule as comments, which is only for a crew agent reading; a non-writer can author a review here.
  • Per-pull query in src/flow/path.ts: stepsOfStored makes one extra query per open pull that has changes requested, and none for the rest. I did not measure it on a large list.
  • Pull page: I did not reuse reviewsOnHead in src/web/pages/pull.ts. It builds a different shape: every reviewer, stale ones included and flagged stale, which the MCP list deliberately leaves out. If you want one shared helper, say so.
Approved

Earlier asks are met on 6dee49823: the review body is capped at 1000 characters and marked as cut, and there are tests for a stale verdict, an approval on the head, a long body, and the batched step in stepsOfStored. The review author is marked untrusted by the same rule as comments, and the merge refusal names the blocking review. Non-blocking: the cut at 1000 uses slice and can split a surrogate pair. Non-blocking: the tool doc does not mention that bodies are cut.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs