Repository navigation
Description
Context
Two remaining clauses from the user-contributed request:
- "When work resumes (AI-in-progress), avoid triggering new assignments or review requests."
- "After follow-up work completes, ensure the PR is assigned appropriately again."
Read together these describe a single rule: the trigger is work completing, never work starting. ProPR swaps labels in both directions - back to <trigger>-processing when a follow-up starts, and to <trigger>-done when it finishes - so an implementation keyed on the label event would fire on both. The previous task avoided that by hooking the code that performs the completion transition rather than a label webhook, and this task extends the same approach to the follow-up path.
The follow-up completion point is handlePostExecution in src/jobs/prCommentPostExecution.ts, after publishCompletionComment and the terminal state update. At that moment the new commit's SHA is known, which matters: the idempotency guard from the previous task is keyed on the head SHA, so a follow-up that pushed a commit is automatically a fresh opportunity, and one that pushed nothing is automatically not.
Two cases need explicit handling. A /review run produces no commit and changes nothing about ownership, so it must not re-assign. And a follow-up may be published to a continuation pull request rather than the original, in which case the assignment belongs to the pull request that actually received the work.
Requirements
- Call
autoAssignImplementationPullRequestfromhandlePostExecutionwithopportunity: 'followup_done', only when the follow-up produced a commit. - Target the pull request the work was published to, taking the continuation into account rather than assuming the comment's pull request.
- Pass the new commit SHA as
headSha, so the existing head-keyed guard makes this a new opportunity exactly when a commit was produced. - Skip entirely for
commandMode: 'review', and for any run that produced no commit. - Resolve the assignee for the follow-up case from the pull request's linked source issue where one exists, so the issue author remains the target rather than whoever commented.
- Never trigger on work starting: add a regression test asserting that the
starting workcomment and the processing-label swap inprocessPullRequestCommentJobperform no assignment and no review request. - Preserve manual assignees here as well, by continuing to rely on the additive default.
- Record the outcome on the task timeline, consistent with the implementation path.
- Tests covering the commit case, the no-commit case, review mode, the continuation target, resumed work, review-request deduplication across both opportunities and failure isolation.
Implementation Specification
Files modified
src/jobs/prCommentPostExecution.ts- invoke after publication.src/github/prAutoAssignment.ts- resolve the linked issue author for the follow-up case.test/prAutoAssignmentFollowup.test.ts(new file).
Step-by-step
- In
prCommentPostExecution.ts, after the terminal state update andpersistCommitHash, call the auto-assign function whencommitResultexists and the command mode is notreview. - Use
context.publication.continuation?.target_pr ?? context.pullRequestNumberfor the pull request number, so a continuation receives the assignment. - Add a
linkedIssueNumberoption toAutoAssignOptions, and inresolveAssigneefall back to reading the pull request body'sCloses #nreference when no issue number was supplied, reusing the existing linked-issue resolution rather than re-implementing it. - Add the Playwright-free unit tests.
Acceptance Criteria
npm run typecheck,npm run lintand the server tests pass.- With the repository option off, follow-up behaviour is unchanged and no assignment call is made.
- A follow-up that pushes a commit re-assigns the pull request; the assignee is the linked source issue's author, or the configured default assignee when set.
- A follow-up that produces no commit performs no assignment and no review request.
- A
/reviewrun performs no assignment, even though it completes successfully. - A follow-up published to a continuation pull request assigns that pull request, not the original.
- Work starting - the processing-label swap and the "starting work" comment - performs no assignment and no review request.
- Two follow-ups producing two commits each re-assign once per commit, and the review request is not duplicated when the assignee already has one pending.
- A manual assignee added between follow-ups still holds afterwards.
- An assignment failure is logged and the follow-up still completes with its commit and completion comment.
- The task timeline shows the follow-up assignment event.
Created by ProPR AI Planner
Activity
propr-dev commentedon Oct 8, 2026
Suggested Implementation:
Implementation Approach
The two clauses in the request look like two features but are one invariant: assign on completion, never on start. Getting that right is mostly a matter of where the call sites are, and the previous task already set the pattern - hook the code that performs the completion, not a label event.
That choice pays off twice here. ProPR swaps the processing label back on when a follow-up starts (
processPullRequestCommentJobposts its "starting work" comment and the label transitions), so anything driven by label events would fire on resume, which the request explicitly forbids. Because the call sites are completion paths only, "avoid triggering new assignments or review requests when work resumes" needs no guard at all - it holds structurally. The task still adds a regression test for it, because the invariant is invisible in the code and a future contributor adding a label-event hook would break it silently.The head-keyed guard pays off too.
headShawas chosen in the previous task specifically so a new commit is a new opportunity. That gives the right answer here for free:Two cases still need explicit code.
Review mode. A
/reviewrun completes successfully and produces no commit, so the head guard would already suppress it. It is skipped explicitly anyway, because relying on "it happens to produce no commit" would break the moment review gained any commit-producing behaviour, and because the explicit check documents that a review does not change ownership.The continuation. A follow-up on a fork contribution publishes to a continuation pull request, not the one that was commented on.
context.publication.continuationalready carries that target. Assigning the commented-on pull request would put the assignment on a pull request that received no code.The assignee for a follow-up. The target stays the linked source issue's author, not the person who left the comment. Assigning the commenter was considered and rejected: it would hand ownership to whoever happened to ask a question, and it would mean every comment from a different person reassigns the pull request. Ownership belongs to whoever asked for the work originally, which is what "assign it to the user who created the original issue" says.
File:
src/github/prAutoAssignment.tsWhy this file: the follow-up path has a different route to the issue author - a pull request body reference rather than an issue payload in hand - so
resolveAssigneegains that fallback. Keeping it here rather than in the caller means both opportunities resolve the target through one function and cannot disagree about who owns the work.File:
src/jobs/prCommentPostExecution.tsWhy this file:
handlePostExecutionis where a follow-up finishes - the commit is pushed, the completion comment is published and the task reaches its terminal state. That is the only point where both "work completed" and "this is the new head" are simultaneously true, which is exactly what the head-keyed guard needs.@@ in handlePostExecution, after persistCommitHash await persistCommitHash(taskId, commitResult?.commitHash, correlatedLogger); + await reassignAfterFollowup({ job, context, taskId, stateManager, commitResult, redisClient }); return { commitHash: commitResult?.commitHash, partial };The function needs the Redis client the module already has access to through its caller; thread it in rather than creating a second connection:
redisClientis already present onPostExecutionParams, sohandlePostExecutionpassesparams.redisClientstraight through. No new connection is opened.File:
test/prAutoAssignmentFollowup.test.ts(new file)Why this file: the invariant this task is really protecting - never assign on resume - is structural rather than written down in a condition, so it needs a test that would fail if someone later added a label-event hook. The continuation case is the other one worth pinning: it is easy to assign the pull request that was commented on and never notice that the code went somewhere else.
propr-dev commentedon Oct 9, 2026
🤖 AI processing has started for this issue using claude agent with claude-opus-5-5 model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
claudeclaude-opus-5-52899/claude-opus-5-5-re-assign-after-follow-up-20261009-1228-7lt2888-epic-task-assignment-1m4issue-2899-20261009-1228-claude-opus-5-5-7lt🔍 Track Task Execution