Skip to content

[3686 by Claude Opus 5.5] A follow-up comment on a ProPR pull request is sometimes never picked up - #3700

Merged
integry merged 3 commits into
3686-epic-0-9-g6ifrom
3686/claude-opus-5-5-a-follow-up-comment-on-a--20261118-0951-9sh
Nov 18, 2026
Merged

integry merged 3 commits into
3686-epic-0-9-g6ifrom
3686/claude-opus-5-5-a-follow-up-comment-on-a--20261118-0951-9sh

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #3686

Branch: 3686/claude-opus-5-5-a-follow-up-comment-on-a--20261118-0951-9sh
Commits: ✅ Changes committed (fdb60f1)


AI Processing Completed

Execution Details:

Summary:
I found two causes and fixed both. The first is proven from the PR timelines. The second is my best reading of the evidence: I had no worker logs, so I couldn't watch it happen. There is no UI change, so no previews.

Cause 1: PRs opened by the retry fallback never got the AI label (#3643, propr-site#222, #226)

Evidence:

What happened: when post-processing doesn't leave a PR, retryPRCreationViaAPI (src/jobs/issueJobPRRetry.ts) opens one, but it never added the labels that normal creation adds. The webhook then treats the PR as not opted in, so every plain follow-up was dropped as no_comment_trigger with only a debug log. /ultrafix still worked on #3643 and #222 because slash commands don't need the label, which is why these PRs looked half-alive. A PR found during final validation had the same gap.

Fix: new src/jobs/pullRequestProcessingLabels.ts adds the processing and model labels, with retries. It never throws, and it can't block the PR retry itself. It is called on the three recovery routes: a PR the retry creates, an existing PR it finds after a 422, and a PR found during final validation. PR_LABEL and modelName are passed in from processGitHubIssueJob.ts.

PRs that already exist without the label are not fixed by this. They need the AI label added by hand before follow-ups on them are accepted.

Cause 2: a follow-up stored behind a running job could be left with no job to pick it up (#3667)

Evidence:

  • The first request (comment 6945632909, 10:37) never got a run.
  • The re-sent text (6947331935, 11:56:00) got a brand-new job, …-1794916564247, created at 11:56:04. So nothing was queued for the PR at that point.
  • That run's receipt lists only trigger-comment-ids=6947331935, so the first comment was not waiting anywhere.
  • The two comments are 79 minutes apart, more than the pending list's 1-hour expiry.

What happened: when any job for the PR exists, intake only appends the comment to the pending-pr-comments Redis list and calls it accepted. An active job has already read that list when it started. It looks once more near the end of its cleanup, and some early-exit paths never look at all. A comment stored after that last look had nothing to read it, and the list expired an hour later: no run, no comment. Which job was running for #3667 at 10:37 is the part I couldn't confirm without logs.

Fix:

  • New packages/core/src/webhook/pendingCommentDrain.ts: after storing a comment, if no waiting or delayed job exists for the PR, intake queues a drain job. That job waits for the PR lock and then picks up the stored comments. If queuing it fails, the webhook delivery fails and is redelivered instead of being lost.
  • cleanupJob no longer queues a second follow-up when a job is already queued for the PR. The queue check lives in the new src/jobs/prCommentQueuedPickup.ts.

On a labelled PR, a matching follow-up now always ends as a queued run, or as one of the existing outcomes (a held follow-up, or the assignment-gate refusal comment). A PR whose first run failed in post-processing now gets its label, so later follow-ups are accepted.

Tests

  • New test/recoveredPullRequestLabels.test.ts (6 tests): the retry route, the 422 route and the found-during-validation route all add the labels; transient label failures are retried and a lasting one is logged. 4 of these fail against the old code.
  • test/commentEventHandler.switch-use.test.ts: 3 new tests (active job → drain queued; delayed job → no drain; a job for a different PR doesn't count). Four existing tests that asserted "nothing queued" behind an active job now expect the drain job. With the drain call disabled, 6 tests fail.
  • test/prCommentCleanupOrder.test.ts: 3 new tests for the cleanup dedupe.
  • 57 related suites (root, core and api tests that touch these files) pass. Lint passes with zero warnings and typecheck is clean for root and core. The Redis integration suite ran 0 tests here because there is no Redis in this container.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (8 files)
    • packages/core/src/webhook/commentEventHandler.ts (+8/−4)
    • packages/core/src/webhook/pendingCommentDrain.ts (added, +74/−0)
    • src/jobs/issueJobPRRetry.ts (+10/−1)
    • src/jobs/issueJobPostProcessing.ts (+16/−3)
    • src/jobs/prCommentJobUtils.ts (+5/−5)
    • src/jobs/prCommentQueuedPickup.ts (added, +28/−0)
    • src/jobs/processGitHubIssueJob.ts (+1/−1)
    • src/jobs/pullRequestProcessingLabels.ts (added, +61/−0)
  • Low risk (3 files)
    • test/commentEventHandler.switch-use.test.ts (+101/−6)
    • test/prCommentCleanupOrder.test.ts (+50/−1)
    • test/recoveredPullRequestLabels.test.ts (added, +149/−0)

Diff size: 11 files changed, +503/−21 lines

View task for the run's logs and conversation.


This PR was created automatically by ProPR after processing issue #3686.


💡 Need changes?

Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!

…melines. The second is my best reading of the evidence: I had no worker logs, so I couldn't watch it happen. There is no UI change, so no previews.

Cause 1: PRs opened by the retry fallback never got the `AI` label (#3643, propr-site#222, #226)

Evidence:
- All three PR bodies read `Resolves #N\n\n_PR created via retry mechanism_`.
- Their timelines have no `labeled AI` event. #3643's only label was `ultrafix`; #222's only label was `ultrafix`; #226 had none.
- For comparison, #3667 was created normally and has `labeled AI` and `labeled llm-claude-opus55` 2 s after it was opened.

What happened: when post-processing doesn't leave a PR, `retryPRCreationViaAPI` (`src/jobs/issueJobPRRetry.ts`) opens one, but it never added the labels that normal creation adds. The webhook then treats the PR as not opted in, so every plain follow-up was dropped as `no_comment_trigger` with only a debug log. `/ultrafix` still worked on #3643 and #222 because slash commands don't need the label, which is why these PRs looked half-alive. A PR found during final validation had the same gap.

Fix: new `src/jobs/pullRequestProcessingLabels.ts` adds the processing and model labels, with retries. It never throws, and it can't block the PR retry itself. It is called on the three recovery routes: a PR the retry creates, an existing PR it finds after a 422, and a PR found during final validation. `PR_LABEL` and `modelName` are passed in from `processGitHubIssueJob.ts`.

PRs that already exist without the label are not fixed by this. They need the `AI` label added by hand before follow-ups on them are accepted.

Cause 2: a follow-up stored behind a running job could be left with no job to pick it up (#3667)

Evidence:
- The first request (comment 6945632909, 10:37) never got a run.
- The re-sent text (6947331935, 11:56:00) got a brand-new job, `…-1794916564247`, created at 11:56:04. So nothing was queued for the PR at that point.
- That run's receipt lists only `trigger-comment-ids=6947331935`, so the first comment was not waiting anywhere.
- The two comments are 79 minutes apart, more than the pending list's 1-hour expiry.

What happened: when any job for the PR exists, intake only appends the comment to the `pending-pr-comments` Redis list and calls it accepted. An active job has already read that list when it started. It looks once more near the end of its cleanup, and some early-exit paths never look at all. A comment stored after that last look had nothing to read it, and the list expired an hour later: no run, no comment. Which job was running for #3667 at 10:37 is the part I couldn't confirm without logs.

Fix:
- New `packages/core/src/webhook/pendingCommentDrain.ts`: after storing a comment, if no waiting or delayed job exists for the PR, intake queues a drain job. That job waits for the PR lock and then picks up the stored comments. If queuing it fails, the webhook delivery fails and is redelivered instead of being lost.
- `cleanupJob` no longer queues a second follow-up when a job is already queued for the PR. The queue check lives in the new `src/jobs/prCommentQueuedPickup.ts`.

On a labelled PR, a matching follow-up now always ends as a queued run, or as one of the existing outcomes (a held follow-up, or the assignment-gate refusal comment). A PR whose first run failed in post-processing now gets its label, so later follow-ups are accepted.

Tests
- New `test/recoveredPullRequestLabels.test.ts` (6 tests): the retry route, the 422 route and the found-during-validation route all add the labels; transient label failures are retried and a lasting one is logged. 4 of these fail against the old code.
- `test/commentEventHandler.switch-use.test.ts`: 3 new tests (active job → drain queued; delayed job → no drain; a job for a different PR doesn't count). Four existing tests that asserted "nothing queued" behind an active job now expect the drain job. With the drain call disabled, 6 tests fail.
- `test/prCommentCleanupOrder.test.ts`: 3 new tests for the cleanup dedupe.
- 57 related suites (root, core and api tests that touch these files) pass. Lint passes with zero warnings and typecheck is clean for root and core. The Redis integration suite ran 0 tests here because there is no Redis in this container.
@propr-dev

propr-dev Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

/ultrafix goal=8 max=3
Triggered automatically by the requested execution settings.

@propr-dev propr-dev Bot added the ultrafix label Nov 18, 2026
@propr-dev

propr-dev Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 3)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev

propr-dev Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR addresses missing labels on recovered PRs and adds queued pickup for comments arriving during active work. It needs a localized correctness fix before merge: treating every delayed job as a sufficient pickup can leave comments to expire before that job runs.

✅ Recovery labels cover all three routes — Newly created retries, duplicate-PR recovery, and final-validation recovery receive processing and model labels.

✅ Compatible drain payloads — Empty-batch drain jobs use the existing atomic pending-comment claim and command-context handling.

The supplied current-head status has no failures and four pending checks. This review used static analysis only; no commands were run.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F1: 🔴 Delayed pickups can outlive pending comments

  • Category: correctness

  • Required behavior: Accepted follow-up comments must retain a runnable pickup until they are processed; cleanup must not suppress their pickup in favor of a job scheduled after their storage expires.

  • Evidence: src/jobs/prCommentQueuedPickup.ts:19–23, packages/core/src/webhook/pendingCommentDrain.ts:49–52, and src/jobs/prCommentJobUtils.ts:416 accept any matching delayed job without considering when it will run.

    1. An active PR-comment job encounters a usage limit. The existing handleUsageLimitError schedules a retry beyond one hour: without a reset timestamp, its delay is one hour plus the configured buffer and jitter. Its payload contains the comments already claimed by that attempt.
    2. After the retry is queued, while the handler awaits posting its GitHub delay notice, a new follow-up arrives. The active job still exists, so intake stores the new comment with a 3,600-second TTL.
    3. ensurePendingCommentDrain finds the delayed usage-limit retry and returns without scheduling an earlier drain.
    4. The active job reaches cleanup. The new hasQueuedPRCommentPickup check finds that same delayed retry and suppresses the follow-up that cleanup previously queued with a three-second delay.
    5. The new comment expires before the retry runs. It is absent from the retry payload, so that accepted request receives no processing.

    The PR lock does not prevent intake during the GitHub request. Atomic claiming and restoration only help after a worker starts; neither renews this newly stored comment while the sole pickup remains delayed. The supplied delayed-job tests check identity, but do not model delay versus expiry. static trace: traced the changed intake and cleanup checks against the supplied usage-limit scheduling, pending-list expiry, and claim/restoration code; this scenario was not executed.

  • Minimum fix: Make both pickup checks account for delayed execution versus pending-comment retention. A matching job scheduled beyond that retention must not suppress a timely drain unless the pending comments are durably retained until its execution. Add a regression covering a comment arriving after a distant usage-limit retry is queued and before cleanup.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Reuse existing label retry policy

pullRequestProcessingLabels.ts adds a separate retry loop, while normal PR creation already uses withRetry and retryConfigs.githubApi for the same labels endpoint. Reusing that policy could reduce duplicated retry behavior while preserving the recovery helper’s nonfatal result. This is optional cleanup; the new bounded retry loop itself is consistent with the requested recovery behavior.

Score

The labeling changes are well scoped, but the new cleanup suppression can lose accepted follow-ups during usage-limit recovery. The passing checks and focused tests do not cover that sequence; four checks remain pending.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 46s
  • Tokens: 61,641 (60,502 in / 1,139 out)
  • Cost: $0.55

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F1 S1

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 5d31f9c

Addressed 1 AI review comment (IDs: 6975709019)

Addressed finding F1

Summary of Changes

I've fixed F1. A delayed PR comment job no longer counts as the pickup for a stored follow-up if it runs after that follow-up's pending list expires. This applies to both intake and cleanup, so the usage-limit retry an hour away no longer blocks the timely drain or follow-up job.

The fix

  • Run time comes from BullMQ's delayed set. Both checks read the delayed job's score with zscore (the run timestamp shifted left 12 bits). I didn't use the job's timestamp + delay fields, because PR-lock waits move the job back to delayed: that rewrites delay relative to the move but keeps the original creation timestamp, so the sum would be too early.
  • Expiry comes from the list itself. Both checks read the list's remaining TTL with pttl, instead of assuming 3,600 s. In cleanup the list may have been written up to an hour earlier.
  • The rule: a waiting job always counts. A delayed job counts only if it runs at least 60 s before the list expires. If either the run time or the TTL can't be read, the code queues the drain rather than suppressing it; the cost is at most one extra job that claims an empty list.
  • Where it lives:
    • Intake: packages/core/src/webhook/pendingCommentDrain.ts, with storeCommentForBatch in commentEventHandler.ts passing in the list's TTL.
    • Cleanup: src/jobs/prCommentQueuedPickup.ts, which cleanupJob now calls with the Redis client and the list key.
    • The check is duplicated in the two packages on purpose. Exporting a new helper from @propr/core would break the test suites that mock that module by listing its exports one by one.

I checked the sibling paths. Every intake route, including slash commands and /switch, goes through storeCommentForBatch, so the one intake change covers them all. The other jobs that sit delayed (lock waits) put their claimed comments back on the list with a fresh TTL, and they are now judged by their real run time too.

Tests

  • New in test/commentEventHandler.switch-use.test.ts:
    • A comment arrives behind an active job while a usage-limit retry is queued 65 minutes out; intake queues a drain.
    • A delayed job whose run time can't be read; intake queues a drain.
    • The existing "delayed job, no drain" test now gives that job a run time 3 s away.
  • New in test/prCommentCleanupOrder.test.ts, each showing cleanup still queues the follow-up:
    • behind a distant usage-limit retry.
    • behind a job due in 5 minutes when the list has only 2 minutes left.
    • behind a delayed job whose run time can't be read.
  • All 5 new regressions fail against the previous source and pass now.
  • All 32 related root and core suites pass, each run on its own. ultrafixRecoveryRedisIntegration ran 0 tests because there is no Redis in this container.
  • Root lint passes with zero warnings, core lint is clean on the changed files, and typecheck is clean for root and core.

There is no UI change, so there are no previews.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (4 files)
    • packages/core/src/webhook/commentEventHandler.ts (+3/−2)
    • packages/core/src/webhook/pendingCommentDrain.ts (+62/−4)
    • src/jobs/prCommentJobUtils.ts (+3/−2)
    • src/jobs/prCommentQueuedPickup.ts (+65/−11)
  • Low risk (2 files)
    • test/commentEventHandler.switch-use.test.ts (+53/−0)
    • test/prCommentCleanupOrder.test.ts (+42/−3)

Diff size: 6 files changed, +228/−22 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 42m 44s
  • Tokens: 6,419,038 (6,418,388 in / 650 out)
  • Cost: $1.80

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

… the pickup for a stored follow-up if it runs after that follow-up's pending list expires. This applies to both intake and cleanup, so the usage-limit retry an hour away no longer blocks the timely drain or follow-up job.

I've fixed F1. A delayed PR comment job no longer counts as the pickup for a stored follow-up if it runs after that follow-up's pending list expires. This applies to both intake and cleanup, so the usage-limit retry an hour away no longer blocks the timely drain or follow-up job.

**The fix**
- **Run time comes from BullMQ's delayed set.** Both checks read the delayed job's score with `zscore` (the run timestamp shifted left 12 bits). I didn't use the job's `timestamp + delay` fields, because PR-lock waits move the job back to delayed: that rewrites `delay` relative to the move but keeps the original creation timestamp, so the sum would be too early.
- **Expiry comes from the list itself.** Both checks read the list's remaining TTL with `pttl`, instead of assuming 3,600 s. In cleanup the list may have been written up to an hour earlier.
- **The rule:** a waiting job always counts. A delayed job counts only if it runs at least 60 s before the list expires. If either the run time or the TTL can't be read, the code queues the drain rather than suppressing it; the cost is at most one extra job that claims an empty list.
- **Where it lives:**
  - Intake: `packages/core/src/webhook/pendingCommentDrain.ts`, with `storeCommentForBatch` in `commentEventHandler.ts` passing in the list's TTL.
  - Cleanup: `src/jobs/prCommentQueuedPickup.ts`, which `cleanupJob` now calls with the Redis client and the list key.
  - The check is duplicated in the two packages on purpose. Exporting a new helper from `@propr/core` would break the test suites that mock that module by listing its exports one by one.

I checked the sibling paths. Every intake route, including slash commands and `/switch`, goes through `storeCommentForBatch`, so the one intake change covers them all. The other jobs that sit delayed (lock waits) put their claimed comments back on the list with a fresh TTL, and they are now judged by their real run time too.

**Tests**
- New in `test/commentEventHandler.switch-use.test.ts`:
  - A comment arrives behind an active job while a usage-limit retry is queued 65 minutes out; intake queues a drain.
  - A delayed job whose run time can't be read; intake queues a drain.
  - The existing "delayed job, no drain" test now gives that job a run time 3 s away.
- New in `test/prCommentCleanupOrder.test.ts`, each showing cleanup still queues the follow-up:
  - behind a distant usage-limit retry.
  - behind a job due in 5 minutes when the list has only 2 minutes left.
  - behind a delayed job whose run time can't be read.
- All 5 new regressions fail against the previous source and pass now.
- All 32 related root and core suites pass, each run on its own. `ultrafixRecoveryRedisIntegration` ran 0 tests because there is no Redis in this container.
- Root lint passes with zero warnings, core lint is clean on the changed files, and typecheck is clean for root and core.

There is no UI change, so there are no previews.

PR: #3700
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor Author

CI failed: Full Test Suite Shard 3/4, Full Test Suite Shard 1/4

Please investigate and fix these CI failures.

  • Check: Full Test Suite Shard 3/4
  • Result: failure
  • Commit: 5d31f9c93bc0 (5d31f9c93bc0672c210cbbe72cc1fed1a3f24895)
  • Run: View CI failure

Failure evidence

.github:11
Process completed with exit code 1.

.github:42661
Process completed with exit code 1.

.github:2
Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24: actions/checkout@11d5960. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/


Failure evidence

.github:11
Process completed with exit code 1.

.github:43695
Process completed with exit code 1.

.github:2
Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24: actions/checkout@11d5960. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/

@propr-dev

propr-dev Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 779e344

Summary of Changes

I fixed the failure. It was caused by this PR, and two shards hit it, not just Shard 3. In both, an older test still assumed that no job is queued while another job for the PR is running. The drain job this PR added now queues one in that case, which is the intended behaviour.

  • Shard 3/4: packages/api/test/taskFollowupRoutes.test.ts, "review batched behind manual work preserves command metadata", failed with 1 !== 0 on the queued-job count.
  • Shard 1/4: packages/api/test/taskReviewRoutes.test.ts, "dedicated review batched behind manual work retains review metadata and its idempotent receipt", failed the same way.

In both tests the only existing job for the PR is a running one. The command is still stored on the pending list and reported as batched, and the new code then queues a drain job to pick it up. That's the same change the earlier commit made to the four core tests in commentEventHandler.switch-use.test.ts.

Fix: I only changed the two tests, not the product code. They now expect exactly one drain job:

  • In the follow-up test, the job is a delayed processPullRequestComment with empty comments and no commandMode. The command itself still goes only to the pending list.
  • In the review test, the repeated request still adds nothing, so the count stays at one.

Verification: both suites pass locally (62 of 62 tests), and lint passes with zero warnings on the two files.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk: none
  • Low risk (2 files)
    • packages/api/test/taskFollowupRoutes.test.ts (+7/−1)
    • packages/api/test/taskReviewRoutes.test.ts (+5/−1)

Diff size: 2 files changed, +12/−2 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-dev[bot]
  • Time: 4m 38s
  • Tokens: 946,485 (942,681 in / 3,804 out)
  • Cost: $0.55

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 6977156358✓

…ds hit it, not just Shard 3. In both, an older test still assumed that no job is queued while another job for the PR is running. The drain job this PR added now queues one in that case, which is the intended behaviour.

I fixed the failure. It was caused by this PR, and two shards hit it, not just Shard 3. In both, an older test still assumed that no job is queued while another job for the PR is running. The drain job this PR added now queues one in that case, which is the intended behaviour.

- **Shard 3/4:** `packages/api/test/taskFollowupRoutes.test.ts`, "review batched behind manual work preserves command metadata", failed with `1 !== 0` on the queued-job count.
- **Shard 1/4:** `packages/api/test/taskReviewRoutes.test.ts`, "dedicated review batched behind manual work retains review metadata and its idempotent receipt", failed the same way.

In both tests the only existing job for the PR is a running one. The command is still stored on the pending list and reported as `batched`, and the new code then queues a drain job to pick it up. That's the same change the earlier commit made to the four core tests in `commentEventHandler.switch-use.test.ts`.

**Fix:** I only changed the two tests, not the product code. They now expect exactly one drain job:
- In the follow-up test, the job is a delayed `processPullRequestComment` with empty `comments` and no `commandMode`. The command itself still goes only to the pending list.
- In the review test, the repeated request still adds nothing, so the count stays at one.

**Verification:** both suites pass locally (62 of 62 tests), and lint passes with zero warnings on the two files.

PR: #3700
Comment by: @propr-dev[bot] (ID: 6977156358)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR is merge-ready within the supplied scope. It restores labels on recovered PRs and adds queued pickup for comments arriving behind active work. Static review found no verified merge blocker. The authoritative checks report 17 passed, none failed or pending.

✅ Recovery label coverage — All three recovery routes apply processing and model labels, with bounded retries and nonfatal failure handling.

✅ Expiry-aware pickup — Both intake and cleanup exclude delayed jobs scheduled beyond pending-comment retention, with regression tests covering distant retries.

✅ Command preservation — Drain jobs claim stored comments through the existing consumer, which applies their command and model metadata.

Review was limited to the supplied code and context; no commands were run.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S2: 🟢 Share pickup eligibility helpers

packages/core/src/webhook/pendingCommentDrain.ts and src/jobs/prCommentQueuedPickup.ts duplicate retention calculations, delayed-score decoding, and the retention margin. Sharing this logic through core would reduce drift between intake and cleanup. Their current decisions are consistent, so this is optional cleanup.

S3: 🟢 Exercise the complete drain lifecycle

The new tests verify enqueue decisions using mocked queue snapshots. A Redis/BullMQ integration test covering intake, pending-list claim, lock contention, restoration, and eventual execution would provide additional confidence that an accepted comment survives the complete lifecycle. Existing atomic-claim coverage and the supplied consumer trace support the implementation; this is additional assurance rather than a merge requirement.

Score

The changes address both reported causes with focused regression coverage and passing current-head checks. No actionable defect was established from the supplied implementation.

Score: 9/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 33s
  • Tokens: 62,277 (61,608 in / 669 out)
  • Cost: $0.54

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix S2 S3

🤖 Review by ProPR

@propr-dev propr-dev Bot removed the ultrafix label Nov 18, 2026
@propr-dev propr-dev Bot changed the title 🔨 [3686 by Claude Opus 5.5] A follow-up comment on a ProPR pull request is sometimes never picked up ✅❾ [3686 by Claude Opus 5.5] A follow-up comment on a ProPR pull request is sometimes never picked up Nov 18, 2026
@integry
integry merged commit bf3063f into 3686-epic-0-9-g6i Nov 18, 2026
42 checks passed
@propr-dev propr-dev Bot changed the title ✅❾ [3686 by Claude Opus 5.5] A follow-up comment on a ProPR pull request is sometimes never picked up [3686 by Claude Opus 5.5] A follow-up comment on a ProPR pull request is sometimes never picked up Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant