Repository navigation
[3686 by Claude Opus 5.5] A follow-up comment on a ProPR pull request is sometimes never picked up - #3700
Conversation
…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.
|
/ultrafix goal=8 max=3 |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 3) First action:
|
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe 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 blockersEvery finding below was introduced by this PR and must be resolved before merging. F1: 🔴 Delayed pickups can outlive pending comments
SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Reuse existing label retry policy
ScoreThe 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
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 5d31f9c
Summary of ChangesI'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
I checked the sibling paths. Every intake route, including slash commands and Tests
There is no UI change, so there are no previews. Review digestRisk-tiered paths
Diff size: 6 files changed, +228/−22 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 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
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
|
CI failed: Full Test Suite Shard 3/4, Full Test Suite Shard 1/4 Please investigate and fix these CI failures.
Failure evidence
Failure evidence
|
|
✅ Applied the requested follow-up changes in commit 779e344 Summary of ChangesI 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.
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 Fix: I only changed the two tests, not the product code. They now expect exactly one drain job:
Verification: both suites pass locally (62 of 62 tests), and lint passes with zero warnings on the two files. Review digestRisk-tiered paths
Diff size: 2 files changed, +12/−2 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…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
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe 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 blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S2: 🟢 Share pickup eligibility helpers
S3: 🟢 Exercise the complete drain lifecycleThe 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. ScoreThe 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
Copy and edit to choose records from this review: 🤖 Review by ProPR |
AI Implementation Summary
Closes #3686
Branch:
3686/claude-opus-5-5-a-follow-up-comment-on-a--20261118-0951-9shCommits: ✅ 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
AIlabel (#3643, propr-site#222, #226)Evidence:
Resolves #N\n\n_PR created via retry mechanism_.labeled AIevent. Fix issue #3642 #3643's only label wasultrafix; Refactor: Clean up 'starting work' comments after PR follow-up processing #222's only label wasultrafix; #226 had none.labeled AIandlabeled llm-claude-opus552 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 asno_comment_triggerwith only a debug log./ultrafixstill 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.tsadds 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_LABELandmodelNameare passed in fromprocessGitHubIssueJob.ts.PRs that already exist without the label are not fixed by this. They need the
AIlabel 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:
…-1794916564247, created at 11:56:04. So nothing was queued for the PR at that point.trigger-comment-ids=6947331935, so the first comment was not waiting anywhere.What happened: when any job for the PR exists, intake only appends the comment to the
pending-pr-commentsRedis 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:
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.cleanupJobno longer queues a second follow-up when a job is already queued for the PR. The queue check lives in the newsrc/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
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.Review digest
Risk-tiered paths
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)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!