Repository navigation
fix(github): Ask for a review again only when every comment of the change request is marked - #3958
sentry-junior[bot] wants to merge 5 commits into
Conversation
…ange request is marked After the requester requests changes on a Junior pull request, Junior asked for their review again whenever it acted after them: any push, including a merge of the base branch, any App comment or reply, and a commit that predated a review on an older head. The feedback tool also asked as soon as the review body was marked addressed, while inline comments of the same change request were still open. Now only an explicit signal asks again. The feedback tool asks the author of a change request when every comment of their latest change request (its body and each inline comment) is marked addressed or declined, and the required checks of the head commit pass. When the checks have not passed yet, it holds the ask, and the next webhook, such as a completed check suite, asks once they pass. A comment or review by the reviewer after the hold drops it. Failing checks do not ask. The next-action webhook no longer infers an ask from pushes, base-branch syncs, App comments, or replies. It still follows the review that GitHub requests, merge readiness, and closes the item when the requester acts. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…-explicit Co-Authored-By: BYK <126780+BYK@users.noreply.github.com> # Conflicts: # packages/junior-github/src/webhooks/pull-request-action.ts
BYK
left a comment
There was a problem hiding this comment.
Maybe we can also check our "local" state if an agent, task, or subagent is already working on the same PR? This would cut down on the GitHub API request and processing all the comments etc. right?
When the feedback tool asks the requester again, the item says that every comment on their change request is handled. When passing checks release a held ask, it says that the checks now pass. Other review requests from GitHub keep the general text. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
|
@BYK It would cut a bit, but not much. In this PR, the GitHub reads for re-asking only happen in two places:
A local "an agent is still working on this PR" check makes more sense as an extra guard than as a way to save API calls. It covers a gap this PR leaves open: the agent marks the last comment, then keeps pushing in the same Turn. It needs a provider-neutral core contract, though, because the plugin can't see Turns or child agents today. So I'd keep it out of this PR and do it as a follow-up. Want me to open the issue? |
|
6 screenshot changes — 6 changed · 0 added · 0 removed Review screenshots in Frameshift |
…equest The feedback tool counts the comment it just marked as marked, because GitHub's GraphQL read can lag behind a new reaction. A "none" read no longer drops a held ask; each webhook checks the hold again. When GitHub rejects the review request, the tool holds the ask, and the webhook keeps a hold until GitHub takes its request, so a later webhook asks again.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes 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 d20f801. Configure here.
A held ask now saves the comment whose mark made it, and the webhook counts that comment as marked, so a GraphQL read that still lags does not drop the hold.

After a requester asks for changes on a Junior PR, Junior asked them to review again before the PR was ready. On #3941 this happened four times while work on the feedback was still going: right after a merge of
main, 40 s after a review of an older head, and after a fix plus amainmerge.There were two causes:
reviewAgainReasonandnextActioninpull-request-action.tscounted any Junior push or App comment after the change request as "Junior acted last". That included base-branch merges. The "new commits with no later requester activity" clause also fired when the requester had reviewed an older head.updatePullRequestFeedbackasked again as soon as the review body was marked addressed, even while other inline comments of the same change request were still open.New rule
Only an explicit signal asks again. Junior must mark every comment of the reviewer's latest change request (the body and each inline comment) addressed or declined with
updatePullRequestFeedback. The head commit's required checks must also pass.pull-request-review-again.tsis new, and the tool and the webhook share it. It reads three things: the reviewer's latest review with Junior's reactions on its body and comments, the head checks, and the base branch's required checks (branch protectionrefUpdateRuleplus rulesetrequired_status_checks). A required check that has not reported yet counts as pending.Other changes
The item text says what caused the ask:
The tool saves a short-lived record in plugin state, so the review request webhook can pick the text. The "has new commits" and "has a reply since you requested changes" texts are removed.
Removed dead code: push activity, review commit oids,
changesRequestedAt,headShaon the merge state, andpull-request-reviews.ts.checkContextStatemoved out ofget-pull-request.ts, so both readers share it.design/github.mdstates the new rule and removes the closed Gap about asking again before the required checks pass.Known limits
check_suitewebhooks release a held ask. If a required commit status reports after the last check suite, the ask waits for the next sync event.via @BYK.
--
View Session [Sentry]