Repository navigation
Description
Problem
After a fix push, Ultrafix posts "⏳ Ultrafix is waiting for CI before the next /review." When CI passes, the loop should run the next review. On 2026-11-17 three loops instead ended as failed within a minute, with no comment on the pull request: #3615 (head da590e9), #3629 (head 461e6fe), #3637 (head fb80750). Afterwards:
get_pull_request_readinessreportsultrafix: { active: false, completionStatus: "failed", labelPresent: true },ai_review: review_stale_head(the new head was never reviewed);- the PR title keeps the previous head's score (
⚠️ ⑥) and theultrafixlabel stays on the PR; - the last ProPR comment on the PR is still the "waiting for CI" notice, which says the loop continues automatically.
The user has to notice the stall and start Ultrafix again by hand.
Daemon log for #3637 (UTC):
03:58:03.996 Ultrafix deferred resume: readiness re-check pr 3637 ready: true
03:58:04.004 Ultrafix loop: enqueued next review step jobId …3637-ultrafix-review-2-2-… delayMs: 5000
03:58:04.004 Ultrafix deferred resume: enqueued next step nextAction: review
03:58:22.030 Ultrafix loop: enqueued next review step jobId …3637-ultrafix-review-3-2-… delayMs: 5000
03:58:22.030 Ultrafix re-arm: enqueued review for stranded loop workEpoch: 3 previousWorkEpoch: 2
03:58:22.030 [ultrafix] continuation resumed by daemon sweep reason: stranded_loop_rearmed cycleCount: 1
03:58:45.932 Ultrafix re-arm: circuit breaker tripped, finishing loop completionStatus: failed
reason: "Ultrafix steps failed 3 times in a row without completing (recovery limit 2)"
03:58:46.730 Ultrafix loop: loop finished cycleCount: 1 goalReached: false
So 18 seconds after the deferred resume enqueued the review (with a 5 s delay, and the review job may also wait for agent capacity when several loops run at once), the daemon sweep judged the loop "stranded", re-armed it under a new work epoch (which supersedes the review that was just enqueued), did so again about 20 s later, and the recovery limit ended the loop. Nothing had actually failed.
Expected / acceptance criteria
- A loop whose next step was enqueued and is still delayed, waiting or running is not "stranded": the sweep does not re-arm it. Re-arming happens only when no job for the loop's current work epoch exists in any live queue state and a grace period (longer than the enqueue delay plus normal capacity waits) has passed since the last enqueue.
- A re-arm that supersedes a job which had not failed does not count toward "steps failed N times in a row".
- With several Ultrafix loops waiting for CI and for agent capacity at the same time (the situation above: about seven loops, three stalled), every loop continues to its next review after CI passes.
- Whenever a loop ends without reaching its goal, for any reason including the recovery limit, the stop notice is posted on the pull request with the reason in plain words, the
ultrafixlabel is removed, and the PR status no longer says Ultrafix is in progress. - Regression tests: (1) deferred resume enqueues a delayed review, the sweep runs before the job starts, the loop is not re-armed and the review runs; (2) the same with the review job waiting for capacity; (3) a loop ended by the recovery limit posts the stop notice and removes the label.
Implementation
Search src/jobs for the log messages quoted above: Ultrafix deferred resume, Ultrafix re-arm: enqueued review for stranded loop, continuation resumed by daemon sweep, circuit breaker tripped (ultrafixLoopContinuation.ts, ultrafixLoopContinuationHelpers.ts, ultrafixCiWait.ts, ultrafixOrchestrationService.ts, ultrafixStopNotice.ts and the daemon sweep that calls them). Find how the sweep decides a loop is stranded and why a just-enqueued delayed job for the current epoch is not seen.
Notes
ProPR runs on SQLite only: do not add code or tests for other databases. Ordinary task runs are one-shot: no mid-run interaction. Another open change in this release (issue #3593, merged into branch 3589-epic-0-9-y3w) edits the same Ultrafix files for stop-notice scores and cycle numbering; keep this change small so the two merge cleanly.
Correction (2026-11-17 04:55 UTC): what actually failed
The review steps did fail, and the daemon sweep is not the first cause. Between the log lines above, the worker refused each enqueued review at admission because free disk space on the worktree filesystem was below the reserve (WorktreeDiskPressureError, packages/core/src/storage/lifecycle.ts), and posted on the pull request (#3637, 03:58:16 and 03:58:35 UTC):
❌ ProPR could not start on
/review— The ProPR worker refused the job because the disk that holds its working copies is nearly full. Nothing was changed on this pull request. Once space has been freed on the worker host, post the command again.
The host frees space with an hourly cleanup, and five minutes later there was room again. Two refusals 19 seconds apart were enough to reach "steps failed 3 times in a row (recovery limit 2)" and end the loop. On #3637 the stop notice then said "Last score: unknown. Max cycles were exhausted", which is not what happened (cycle 1 of 6, last score 6/10); on #3615 no stop notice was posted at all.
Revised acceptance criteria (these replace the first two bullets above; the stop-notice bullet stays):
- A step refused at admission for disk pressure (or any other "could not start, nothing was changed" refusal) is a transient condition for Ultrafix: the loop waits and retries the same step with backoff (for example 2, 5, 10, 20 minutes, up to about an hour in total) instead of counting it toward the consecutive-failure limit. It posts one notice saying it is waiting for disk space, not one refusal comment per attempt.
- If space does not return within that time, the loop stops with a stop notice that names the real reason ("the worker had no free disk space"), the real last score and the real cycle count.
- The daemon sweep does not re-arm a loop faster than this backoff.
- Regression tests: two consecutive disk-pressure refusals followed by a successful admission continue the loop; persistent refusals end it with the correct notice.
Activity
propr-dev commentedon Nov 17, 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-53642/claude-opus-5-5-ultrafix-the-loop-ends-as-20261117-0428-tl83642-epic-0-9-y57issue-3642-20261117-0428-claude-opus-5-5-tl8🔍 Track Task Execution
propr-dev commentedon Nov 17, 2026
Post-processing Error:
API rate limit exceeded for installation ID 68212616. If you reach out to GitHub Support for help, please include the request ID 811E:25ECF5:6614E5C:99AD873:6AFBDB46 and timestamp 2026-11-17 04:42:46 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
AI Processing Completed
Execution Details:
Summary:
I fixed both halves of the issue. The sweep no longer re-arms a loop whose next review was just enqueued. When a loop ends without reaching its goal, it now posts the reason in plain words and removes the
ultrafixlabel.Why the sweep saw a "stranded" loop. The sweep decided a loop was stranded with a single queue scan. That scan looked only at
waiting,activeanddelayedjobs, and nothing recorded that a step had just been enqueued. So any scan that missed the review meant the loop looked idle and got re-armed under a new epoch, which supersedes that review. A miss can happen while the job moves between queue states during a capacity or PR-lock wait, or when the job sits in a state the scan didn't list, such asprioritized. An existing test (a re-arm that misses a pending review in the queue scan supersedes it) had pinned this as intended behaviour; I replaced it. I couldn't prove from the logs which of these happened in the three stalled loops.What changed
src/jobs/ultrafixStepEnqueueMarker.ts: every enqueued step now records its job ID, epoch, time and delay in Redis.ultrafixStrandedLoopRearm.ts): before re-arming, the sweep looks that job up directly. If it is in any live state, or it can't be found and less than its delay plus 10 minutes has passed, the loop is left alone. The sweep then schedules a later check instead of acting. A job thatfailedorcompletedis not held, so a step that really failed is still recovered at once (failed jobs are kept for 7 days, so they stay visible).prioritized,waiting-childrenandpaused./ultrafix.docs/docs/features/pr-commands.mdis updated to match.Tests. The three regression tests are in
test/ultrafixCiFailureRecovery.test.ts:prioritizedjob is also seen by the scan.I added a fourth test showing a job that has vanished is re-armed only after the grace period, and a label-removal check to the CI-timeout test.
Results. All 24 Ultrafix suites and
checkRunHandlerpass, and so does the docs manifest test. Root typecheck and lint with--max-warnings 0on the changed files are clean. The four new or changed tests fail when the fix is temporarily disabled. The real-Redis integration suite didn't run because there's no Redis in this container.The scenario with about seven loops running at once was tested only through these simulated queue states, not under real load. The change touches the stop-notice code that #3593 also edits, though only with a few added lines.
There are no visual previews because nothing visible in the UI changed.
Detailed Logs:
cc85cfee-0d12-4ec1-9843-43a58bdf6a07Log files stored at:
/usr/src/app/logs/executions/issue-3642-2026-11-17T04-42-49-762Z-conversation.json/usr/src/app/logs/executions/issue-3642-2026-11-17T04-42-49-762Z-output.txtLatest Conversation Messages
This processing report was generated automatically by ProPR for issue #3642.
Fix issue #3642 (#3643)
feat(ai): I've implemented the Correction section from #3642. When th…
feat(ai): Shard 4/4 had one real failing test, `test/ultrafixCiFailur…