Repository navigation
fix(github): Ask the requester when Junior hands a PR decision back - #4305
Conversation
A change request asks its reviewer to review again only when Junior marks each of its comments. Junior marked only comments it acted on, so a reply that pushed back, deferred, or asked the reviewer to decide left the comment unmarked. The requester then got no Inbox item, and the pull request left Code · Mine. The pull request event guidance now says to mark those comments too, and the feedback tool's status says what declined means. Co-Authored-By: BYK <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This comment has been minimized.
This comment has been minimized.
|
6 screenshot changes — 6 changed · 0 added · 0 removed Review screenshots in Frameshift |
A question that Junior asks the requester in a pull request comment outside a change request added no Inbox item. A child agent cannot add one, and the next action of the pull request had no signal for it. github_commentOnPullRequest gets asks_requester. When set, the tool asks the person who asked Junior for the pull request for a review on GitHub. GitHub notifies them, and the pull request's one next-action item shows the review ask, with the pull request as its subject. Co-Authored-By: BYK <[email protected]>
…d-back-feedback Co-Authored-By: BYK <[email protected]>
The opener lookup and the work owner lookup ran outside the ask's try. A failure there failed the tool after GitHub took the comment, so a retry could post it twice.
A comment that Junior pushes back on or defers is declined, so the review-again ask fires. A question to the requester in a PR comment asks for their review on GitHub, which puts the PR in their Inbox. Co-Authored-By: BYK <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 16a7bc9. Configure here.
The opener lookup also returns the first person who asked Junior to update a pull request that someone else opened. That row has no Conversation, so the PR has no Inbox item for them. Skip the review ask for it, as the ready-for-review ask does.
BYK
left a comment
There was a problem hiding this comment.
The item text is the general "GitHub asks you to review #N." A text for a question needs a new reason in pull-request-action.ts, and that file is in stack #4307.
Let's do this too? Can be a follow up on that stack if it's not there already?
|
@BYK No open PR has it yet, so it'll be a follow-up on stack getsentry/junior#4307. It adds a review-ask reason for a question that Junior asked, so the item says "Junior asked you a question on #N." instead of the general review text. I'm getting the stack base before I open it. |
) When Junior asks the requester a question in a PR comment (`github_commentOnPullRequest` with `asks_requester`, from #4305), the Inbox item shows the general "GitHub asks you to review #N." The requester can't tell from the item that a question waits on them. ## Changes - `pull-request-review-again.ts`: the review-asked mark gets an optional `reason` (`handled` or `question`), and `GitHubReviewAskReason` adds `question`. An unset reason still means `handled`, so the feedback tool's marks keep working. - `comment-on-pull-request.ts`: before it asks for the review on GitHub, the tool writes the mark with `reason: "question"`, the same way the feedback tool marks a review-again ask. GitHub records no new review request for a reviewer that it already asks, so a requester who replied after GitHub's last ask would still count as acting last. When GitHub already asks the requester, the tool removes the request and adds it again, so GitHub records a new ask and sends its `review_requested` webhook. If the request fails after that removal with a rate limit or server error, the tool tries it once more. - `pull-request-action.ts`: - `askReason` returns the mark's reason, and the item text for `question` is "A comment asks you a question." - A comment-only review keeps the review item open, so a question can come while the item already shows "review". A fresh question mark therefore counts as a change for a review or draft action: it updates the open item once. The mark is dropped only when a review item shows it, so a sync that closes the item keeps it for the review request that follows. - `pull-request-action-text.ts`: the item and close text moves here from `pull-request-action.ts`, which keeps that file under the file-length limit. No new table: the mark is the existing 1-hour state key, and it only has to outlive GitHub's `review_requested` webhook. The item has no link to the comment. Its URL is the PR, which the dashboard shows as one card. The text can't name the bot because the `no-hardcoded-bot-name` rule forbids it: each install configures the bot name. ## Design `design/github.md` gets a rule next to the hand-back rule from #4305: "When Junior asks the requester a question in a PR comment, it asks for their review on GitHub, and the Inbox says that Junior asked them a question." <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3Aeb8917bd0ee6f1c48d0ea567d9aab5d9 --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3Aeb8917bd0ee6f1c48d0ea567d9aab5d9) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Aeb8917bd0ee6f1c48d0ea567d9aab5d9/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: BYK <[email protected]>
…not declined (#4437) On #4428, Junior agreed with two inline review comments on `design/lead.md`. It replied with the replacement text and asked the reviewer to confirm, because a `design/` line changes only after the person confirms its exact text. Then it marked both comments `declined`, which adds a -1 reaction. The reviewer read it as a rejection. ## Root cause The `status` param of `github_updatePullRequestFeedback` put "leave the decision to the author" under `declined` (-1), and it limited `addressed` (+1) to "you made the change or answered the question". An agreement that waits on the reviewer's confirmation fits only the `declined` text. #4305 added that clause. `design/github.md` says only that a comment Junior pushes back on or defers is declined. ## Fix - The `status` param now puts an agreement that waits on the reviewer to confirm or choose under `addressed`. `declined` covers only push-back and deferral to later work, and the text says that reviewers read -1 as disagreement. - New eval case in `pull-request-reviews.eval.ts`: the requester asks for a `design/` change that needs their confirmation of the exact text, and the mark must be `addressed`, never `declined`. The existing push-back case still expects `declined`. The review-again ask does not change. It counts both +1 and -1 as marked (`pull-request-review-again.ts`), so a comment that waits on the reviewer still puts the pull request back in their Inbox. <!-- junior-request-attribution:start --> via @dcramer. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A1f134128a4bde1e5a67108f95b9d1415 --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3A1f134128a4bde1e5a67108f95b9d1415) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A1f134128a4bde1e5a67108f95b9d1415/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>

When Junior hands a decision back to the requester in a pull request comment, the requester gets no Inbox item, and the pull request leaves Code · Mine. This happens in two ways.
Inside a change request. Only Junior's mark asks the requester to review again (
pull-request-review-again.ts). The event guidance said to mark a comment only "after acting on actionable feedback or answering a question". So a reply that pushed back, deferred, or left the decision to the reviewer left the comment unmarked. Examples: getsentry/devinfra-deployment-service#1019 (review body answered with a disagreement, unmarked) and #4100 (inline comment deferred to a later refactor, unmarked).Outside a change request, such as a reply to a comment-only review. A comment-only review ends GitHub's review request, so the next action ends too. A question back to the requester then has no signal, and a child agent cannot add an Inbox item.
Changes
events/pull-request.ts: the feedback guidance says to mark a comment after Junior acts on it or replies to it, also when Junior pushes back, defers, or answers with a question.github_updatePullRequestFeedback: thestatusparam says what each value means. "declined" covers push-back, deferral, and a decision left to the author.github_commentOnPullRequest: newasks_requesterparam. When it is true, the tool asks the person who asked Junior for the pull request for a review on GitHub, and returnsrequester_asked. It asks only when Junior opened the pull request for the person whose work the Turn does, and that person has a linked GitHub account.design/github.md: a comment that Junior pushes back on or defers is declined, and a question to the requester in a PR comment asks for their review on GitHub.pull-request-reviews.eval.ts: a pushed-back change request is marked declined, and a comment-only review is answered withasks_requesteronly when the requester asked to decide.Design
The review request carries the signal, so
pull-request-action.tsdoes not change. GitHub'sreview_requestedwebhook already makes the next action "review" when the requester has not acted since they were asked. That shows the pull request's onepull-request-action:item, with the pull request as its subject, assigned to the requester. GitHub also notifies them. When they review, GitHub ends the request, and the item closes. No new item stream, table, or state key.A "reply" action from Junior's latest comment would not work, because the derivation cannot tell whether a comment asks the requester something. Every "Fixed in abc" reply would ask them.
Trade-offs:
pull-request-action.ts, and that file is in stack getsentry/junior#4307.via @BYK.
--
View Session [Sentry]