Skip to content

fix(inbox): the owner-approved Pull requests hand-off message - #2606

Merged
backnotprop merged 8 commits into
mainfrom
fix/pull-handoff-message
Nov 4, 2026
Merged

backnotprop merged 8 commits into
mainfrom
fix/pull-handoff-message

Conversation

@backnotprop

@backnotprop backnotprop commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

The message the Inbox sends when you hand a pull request to an agent now uses the owner's approved text. The agent is asked to help you review and understand the PR. It must not change code unless you explicitly tell it to. It must not push, comment on the PR, approve it or merge it. The text is the same for your own PRs and for a teammate's.

Approval: .product/approved/pull-handoff-message/approval.md (2026-11-04, Inbox thread "Branch inbox threads / code review", question q-28ce07da, answer "A · Yes, as shown").

What changed

  • The message. It opens with "You're being asked to help me review and understand a pull request. Don't change any code unless I explicitly tell you to." A "Pull request" section follows, with one line each for the title, number, repository, link, branch and author. Then "What to do": step 1 asks for a guided review through /review-curate, and step 2 says you discuss it in the thread.
  • Your own PR says "Author: me". A teammate's PR gives their login and adds "Include what I might ask ." to step 1. An unknown author is "a teammate".
  • Titles are plain text on one line, with no backticks around them. Control and bidi characters are removed, line breaks become spaces, and the title is cut at 100 characters. So a title can't add a line, such as a fake "- Link:" line.
  • Lines are left out when they aren't safe. An unsafe head branch is dropped and "into main" stays. An unsafe base branch drops the Branch line entirely. The Link line is dropped when the URL isn't on the PR's own host. GitLab says "merge request" throughout.
  • Custom curation: your words follow /review-curate in step 1, in place of the default.
  • Stacks list each open layer, bottom first, as #412 <title> · <link> · branch <head>. Step 1 is the owner-approved text (.product/approved/stack-show-me/approval.md, q-55141171): "1. Send me a guided review of the whole stack's diff, from to , using /review-curate (its instructions are at the end of this message). Walk it layer by layer, in landing order, with what to watch in each." An unsafe top branch name gives "to the top pull request's branch". In custom curation, the person's words replace the "Walk it…" sentence. The old "one chapter per layer, on that layer's own diff" words are gone. The rest of the stack wording (the opening, the "Stack" section and the plural step 2) still needs approval.
  • Removed: the safety line that was held back (PULL_HANDOFF_AUTHORS_LINE), the old "Own pull request" and "Help me review" texts, and the code-span title (pullTitleCode is now pullTitleLine).
  • + New agent: compose still tells a guided review from a custom one. pullHandoffAskLine now returns the whole step 1 line, and pullLaunchAsk checks that this line is still in the message on a line of its own.
  • Thread name (owner, q-49bd0699 A): a handed-off thread is named "Review Large MR files with collapsed diffs show 0 changes in review UI #869: <title>" (GitLab "Review !61: …"; a stack "Review Skill description exceeds new 250-character limit in Claude Code 2.1.86 #412 to feat(review): add Azure DevOps PR review support #414: "). The title is on one line and the name is cut to the 120-character thread-name limit. Review sends it as the person's own thread name. If another open thread in the project already has that name, the thread starts without one. "+ New agent" opens compose with the name in the thread chip. The message body is unchanged.
  • Tree stacks (two open PRs on one branch): the hand-off covers only the chain up to the layer the stack view is open on, so the list, step 1's "to" branch and "in list order" stay true. A straight chain is handed over whole, as before.
  • One open-layer rule: openLayers and isOpenPull in pulls/model.ts. The opening line and step 2 are now built once for a single PR and for a stack.
  • Docs: the Pull requests hand-off section in docs/agent-guides/inbox-files-and-guides.md now has the new text.

Tests

  • packages/inbox/pulls/pullReview.test.tsx (with and without DOM_TESTS=1): the approved text, word for word; one test per variant (a teammate, an unknown author, GitLab, custom curation, an unsafe branch, no link, a stack); a hostile title that stays one inert line; pullLaunchAsk against the new step 1.
  • packages/server/inbox-pulls.test.ts.
  • tests/e2e/inbox-pull-requests.spec.ts on the compiled binary, with fake gh and glab; it now also checks that the Inbox list shows the thread as "Review Large MR files with collapsed diffs show 0 changes in review UI #869: …".
  • New unit and DOM tests: the thread names (single PR, stack, GitLab, a hostile title, the length limit), the name on the Review path, the "+ New agent" compose prefill, a taken name, a tree stack and a GitHub Enterprise host. The server fixture's ask_line now holds the current step 1.
  • tsc for packages/inbox and apps/inbox.

Open points for the owner

  • The stack wording outside step 1 still needs the owner's approval.

backnotprop and others added 6 commits November 4, 2026 10:35
One version for every PR, the person's own or a teammate's: help me
review and understand it, change no code unless told, a Pull request
section of plain lines, then the guided review and the discussion with
no push, comment, approval or merge. Titles are plain text on one line;
the held authors line is removed. The stack wording awaits approval.

Co-Authored-By: Claude <[email protected]>
Step 1 for a stack is the owner-approved text (stack-show-me,
q-55141171): a guided review of the whole stack's diff, from its base to
the top layer's head, walked layer by layer in landing order. Custom
curation replaces the walk. The old per-layer ask words are gone.

Co-Authored-By: Claude <[email protected]>
…f a tree stack's chain only

Thread name (owner, q-49bd0699 A): pullHandoffThreadName gives
"Review #869: <title>" (GitLab !61; a stack "Review #412 to #414: …"),
one line, cut to the thread-name limit. Hand sends it as the person's
thread_name and starts the thread without it when another open thread
has it; + New agent opens compose with it in the chip. The message body
is unchanged.

Review fixes: a tree stack hands over only the chain up to the layer the
view is open on (handoffStack), so its list, step 1's "to" branch and
"in list order" stay true. One open-layer helper (openLayers,
isOpenPull); the opening and step 2 are built once for a PR and a stack.
Tests for the names, the prefill, a taken name, a tree, a GHE host; the
server fixture's ask_line is the current step 1.

Co-Authored-By: Claude <[email protected]>
…be handed on its own

Review findings 2 to 5 on #2606 (finding 1, the name on a re-handed PR, waits on the owner).

- Tree stacks: the thread name says "#412 to #414" only for a straight run of the
  stack's open layers; a chain that skips one reads "Review #412, #414: <title>"
  (numbers cut with ", …" past 60 characters, the name within 120).
- handoffStack(stack, links, thread) replaces the target parameter the UI never
  used: the layers no thread has yet (or the ones a thread has, for Hand again).
  After #412 and #414 go to one thread, the stack view says "No agent yet for
  #413" and hands #413 on its own, a single PR's hand-off against #412's branch.
- layerVerdictLink: in a tree a layer falls back only to the thread of a layer
  above it on its own chain, so #413's verdict never goes to #412/#414's thread.
- One open-PR rule: core exports inboxPullIsOpen; the stacks, the server's pull
  review route, postRules, PullReview's layer strip and PullsPage use it. The
  thread name is computed once per hand-off line.
- Titles are cut between graphemes (Intl.Segmenter), never inside a ZWJ
  sequence or a flag; a title of only zero-width characters is "(no title)".

Message text is byte-identical for every non-tree variant (before/after compare).
The owner has not approved "No agent yet for #413" or a second "Ask for"
line, and is redesigning this page, so this PR adds no visible text or
layout. The stack view renders as on main: "No agent yet" only with no
agent, one hand-off line (Ask for, or Hand again for). A tree's sibling
left out of the agent's chain shows what main shows for any linked stack.

Kept (invisible): tree verdict routing (#413 has no agent until it is
linked), "Review #412, #414: …" for a chain that skips a layer, the shared
inboxPullIsOpen, grapheme-safe titles. handoffStack is unchanged; the page
uses it for the first hand-off (the chain to the top) and Hand again.

Tests: the DOM test for the sibling's own hand-off line is gone; a DOM test
now checks the page hands a tree's chain to its top and then shows no
extra line. Routing and name tests stay.
@backnotprop
backnotprop marked this pull request as ready for review November 4, 2026 16:49
@backnotprop backnotprop added the ci:full Run the heavy CI tier on this PR (added by the merge script) label Nov 4, 2026
@backnotprop
backnotprop merged commit 8893eeb into main Nov 4, 2026
68 checks passed
backnotprop added a commit that referenced this pull request Nov 4, 2026
#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.
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