Skip to content

feat(inbox): review a PR with an agent, inline (take A) - #2615

Merged
backnotprop merged 4 commits into
mainfrom
feat/pulls-review-with-agent
Nov 5, 2026
Merged

backnotprop merged 4 commits into
mainfrom
feat/pulls-review-with-agent

Conversation

@backnotprop

@backnotprop backnotprop commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

Builds take A · Inline of "Review with an agent" (approval .product/approved/pr-page-review-with-agent/approval.md, q-8a095fc3) into the Pull requests page and the PR review. Base: #2608 (fix/pulls-break-ui at 11a0bc7a8).

What changes

  • Stack view. There is one primary under the title in each state:
    • Review with an agent opens the picker inline (pulls/ReviewPicker.tsx).
    • Open review thread is the primary once a thread exists, and stays the way in after the guided review arrives (decision 3).
    • Start a new review thread is the primary after the agent ended.
    • Open the diff stays beside the primary. The Reply foot stays.
  • Picker. It has Ask for, then the project's running agents as one radio list. Start a new agent shows only while compose's sessions answer carries a launch block. The picker's send path (owner check, startThread, pullOwner, idempotency keys, session_not_live) is the same one the old hand-off used.
  • Verdict routing. A Whole stack verdict goes to the stack's one review thread, which is its lowest linked layer's (stackVerdictLink, decision 6). This matches Pull requests: fixes from the worst-case stress test #2608's routing. This layer still goes to the layer's own agent.
  • Removed.
    • The hand-off pills and the Thread chip, the other-agent chips, "No agent yet" and "Start review".
    • The multi-agent note, and the "has it / opened it / had it" row words.
    • otherLayerAgents and stackAgentsWords, the unavailable agent in PostEnding, and their CSS.
    • No visible "hand" word remains. The text sent to agents is unchanged.
  • PR review.
    • There is one title: GuideReader / GuideView take a new bare prop.
    • The header has no repository, and the strip shows numbers only.
    • Under 900 px the rail folds into the "Files · N files" picker.
    • useNarrowerThan takes drawn, so it measures once the review is drawn.
  • Docs. docs/agent-guides/inbox-files-and-guides.md (the Pull requests section) is rewritten for this flow.

No new keyboard shortcuts. packages/ui is untouched.

Tests

  • packages/inbox/pulls/pullReview.test.tsx: 46 pass. It covers none → picker → start, Cancel and Escape, Custom curation, the 20-PR limit, launch-only Start a new agent, the pick order, ended mid-start, the re-read on focus, idempotency, the picker per PR, focus after start, Open the diff in each state, the thread state, ended, and a teammate's PR. It also covers one send at a time (the button waits until the link arrives), the limit before Start a new agent, and the picker not reopening after a launch. Each of these three fails when its fix is removed.
  • packages/inbox/pulls/model.test.ts: 22 pass, including the new Whole stack routing and the row words.
  • These also pass:
    • GuideView.test.tsx 13
    • GuideViewportManager.test.tsx 5
    • reviewPane.test.tsx 10
    • guideDiffStyle.test.tsx 4
    • typecheck of packages/inbox, apps/inbox and packages/guide-viewer
  • tests/e2e/inbox-pull-requests.spec.ts: 11/11 pass with PLANNOTATOR_E2E_VIDEO=1, both videos included. This covers the picker, the real start, the guided review arriving with Open review thread, the rail fold at 1024 with the diff taking the width, and 44 px phone targets.

Shots

They are in /tmp/review-with-agent/built/ (sheet.png plus 61 shots). They cover the states none, picker, just started (the real flow), guided review arrived, thread, ended and ended-picker, on desktop 1440 light and dark and on phones at 390 and 320. They also include the mixed-agent stack (decision 6), the list, and the review at 1440, 1024, 800 and 390.

Words

Approval: .product/approved/pr-page-review-with-agent/approval.md (q-8a095fc3, take A · Inline).
The text sent to agents (pullHandoffMessage, pullHandoffAskLine, the /review-curate block) is unchanged.

New or changed

Where Words
Stack view, no review thread: the primary Review with an agent
Picker: ask Ask for · [ Guided review | Custom curation ] (kept)
Picker: list heading Running in {repo} (aria: "Agent, running in {repo}")
Picker: reading / none Looking for running agents… · No agent is running in {repo}.
Picker: a session row {Agent} · {title} or No title yet · Working or Started {12m} ago
Picker: launch row (only where this Inbox can start agents) Start a new agent · its sub-line names the agents it can start, e.g. "Claude Code or Codex"
Picker: buttons Start review thread / Starting… · Cancel
Picker: errors A stack of more than 20 open pull requests can't go to one review thread. · The review thread was not started.
Stack view, thread exists: the line Review thread with {Agent}, then muted: Guided review on the way / Custom curation on the way (until the guided review arrives), else the last answer's time, else No answer yet
Stack view, thread exists: the primary Open review thread (also after the guided review arrived)
Stack view, agent ended: the line {Agent} ended
Stack view, agent ended: the primary Start a new review thread (opens the same picker, without that agent)
Beside the primary, every state Open the diff (unchanged)
List row, third line Review thread with {Agent} · {Agent} ended (and "Review thread with {Agent} · your review" in the reason)
Review, read-only note on the person's own PR with no thread No review thread yet
Review header the repository name is gone; under 1100 px Back is its arrow only; under 900 px the rail is Files · N files (the phone picker's words)

Removed

  • "No agent yet" (stack view and review note), "No live agent" / "No live agent in this project"
  • "Review" (the purple hand-off button) and its description "With {Agent}" / "With a new agent"
  • "Agent" (the hand-off's second label), the session pills, "New agent" / "Launch an agent"
  • "Hand to another agent", "Hand again for", "Handing it over…", "It was not handed over.", "…can't be handed over here."
  • "Start review" (the guided review's button once it arrived)
  • The "Thread · {subject}" chip and the "Open {Agent}'s thread: {subject}" chips for other agents
  • "{Agent} has it", "{Agent} opened it", "{Agent} had it", "has it · no answer yet"
  • "{Agents} each have layers here. Send to an agent from This layer." (the multi-agent note)
  • The guide reader's own title, counts and source line inside a PR review (the header's title is the one title)

Diff width in the review (ledger !62, measured by the same script)

Viewport #2608 (11a0bc7) This branch Rail
1440 1094 px 1142 px 264 px
1024 446 px 758 px folded
800 254 px 534 px folded
390 — 356 px phone picker

…ew-with-agent, take A)

One primary under the stack view's title per state: Review with an agent
opens the picker inline (Ask for, the project's running agents, Start a new
agent only where this Inbox can start agents); a review thread reads
"Review thread with {Agent}" with Open review thread, also once the guided
review arrived; an ended agent reads "{Agent} ended" with Start a new
review thread. Open the diff stays beside it; the Reply foot stays.

Whole stack's verdict goes to the stack's one review thread, its lowest
linked layer's. Removed: the hand-off pills, the Thread chip, other-agent
chips, No agent yet, Start review, the multi-agent note, and every visible
hand word. The agent-facing hand-off text is unchanged.

The PR review has one title (the reader is bare), no repository in the
header, and under 900 px the rail folds into the Files picker: the diff
is 534 px at 800 (was 254) and 758 px at 1024 (was 446).
…too; balance on the PR title

Review with an agent is off while a send runs and until the new link
arrives (15 s at most), so a second thread can't start. The 20-PR limit
is checked before Start a new agent as well as before a running agent.
Start a new agent closes the picker, so it never reopens by itself when
that agent later ends. text-wrap: balance moves from the Board card
heading back to the PR title (.ib-pr-h). The Ask for options are 44 px on
a phone and in the e2e's phone targets. stackVerdictLink's comment says
what it does; launchHosts and launchWords are no longer exported; the
DOM tests check each label's own element instead of joined text.
@backnotprop
backnotprop changed the base branch from fix/pulls-break-ui to main November 4, 2026 22:10
#2608 merged with main's later hand-off work (#2606 approved message, thread
names, tree stacks; #2584 global comments). Kept this branch's review-thread
picker and one-thread model, and carried main's behaviour into it:
- ReviewPicker sends the thread name (pullHandoffThreadName) and retries
  unnamed on 409 thread_name_taken with the same idempotency key; Start a new
  agent passes it to compose.
- The picker works on handoffStack (a tree's chain; after an ended agent, the
  layers that thread had), for keys, ask line and message.
- PullReview keeps main's early fold/sheet block plus this branch's drawn
  measure and rail fold.
- GuideView bare keeps the global comment button, in a non-floating row.
- Main's hand-off tests ported to the picker; docs merged.
@backnotprop
backnotprop marked this pull request as ready for review November 4, 2026 22:29
@backnotprop backnotprop added the ci:full Run the heavy CI tier on this PR (added by the merge script) label Nov 5, 2026
@backnotprop
backnotprop merged commit 0d6e1cc into main Nov 5, 2026
62 checks passed
backnotprop added a commit that referenced this pull request Nov 5, 2026
#2615 moved the new-agent offer into ReviewPicker, so the check for a repository with no project moves there too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:full Run the heavy CI tier on this PR (added by the merge script)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant