fix(selfhost): re-drive the review a restart orphaned, not just its lock - #9868
fix(selfhost): re-drive the review a restart orphaned, not just its lock#9868JSONbored wants to merge 2 commits into
Conversation
#9802 heals the active_review_tracking row at boot so the next pass cannot bounce off a stale lock. That is only half the failure: the interrupted pass had ALREADY published the "LoopOver is reviewing..." placeholder comment, and terminalizing the row does not replace it. Nothing else re-drives the PR either -- the head has not moved so no webhook fires, and the review cache is empty because the pass never finished. The PR sits claiming a review is in progress, forever. Observed on JSONbored/metagraphed#8693: three container recreates in one afternoon -- two of them routine config reloads -- each killed a mid-flight review. That PR showed "reviewing..." for 25+ minutes with zero published reviews and zero queued work until a human noticed. Every deploy during a review does this, which is why it has recurred. So the boot sweep now enqueues an agent-regate-pr for each row it heals. `force` bypasses the AI-review cache and reuse cooldown, which is right here: the interrupted pass produced nothing to reuse, and the one-shot cadence would otherwise replay a stale review or none at all. prCreatedAt is carried deliberately (#9499): omitting it INVERTS the queue order -- jobClaimSortKey would fall back to a ~9.5e11 base that sorts ahead of every real 2026 PR, so an orphan re-queue would jump the whole contributor backlog. The repo's regate-sort-key check caught exactly that on the first attempt. Fail-safe throughout: a lookup or enqueue failure logs and continues, because a healed row with no re-queue is still strictly better than a wedged one, and the remaining rows still need healing. An unregistered repo logs a named skip rather than enqueueing a job that cannot act.
|
Warning ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-29 18:39:59 UTC
Review summary Nits — 6 non-blocking
Concerns raised — review before merging
📋 Copy for AI agents — paste into your coding agentDecision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionNot yet addressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. Decision record
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9868 +/- ##
==========================================
- Coverage 91.74% 90.87% -0.88%
==========================================
Files 918 918
Lines 112965 112972 +7
Branches 27184 27187 +3
==========================================
- Hits 103642 102658 -984
- Misses 8037 9226 +1189
+ Partials 1286 1088 -198
Flags with carried forward coverage won't be shown. Click here to find out more.
|
The half-fix
#9802 heals the
active_review_trackingrow at boot, so a restart no longer leaves a PR wedged behind a stale lock. That solved the lock. It did not solve the comment.An interrupted pass has already published "🔍 LoopOver is reviewing…". Terminalizing its tracking row does not replace that comment, and nothing else re-drives the PR:
reconcile-open-prs/reconcile-active-review-trackingare both disabled on the production ORBSo the PR sits claiming a review is in progress. Forever.
Observed, not theorised
JSONbored/metagraphed#8693. Three container recreates in one afternoon — two of them routine config reloads — each killed a mid-flight review. State 25 minutes later:The maintainer saw "reviewing…" indefinitely. Every deploy during a review does this, which is why it has recurred rather than being a one-off.
The fix
The boot sweep now enqueues an
agent-regate-prfor each row it heals.force: truebypasses the AI-review cache and the reuse cooldown — correct here, because the interrupted pass produced nothing to reuse and the one-shot cadence would otherwise replay a stale review, or none at all.prCreatedAtis carried deliberately. Omitting it doesn't merely lose ordering, it inverts it:jobClaimSortKeyfalls back to a ~9.5e11 base that sorts ahead of every real 2026 PR (~1.78e12), so an orphan re-queue would jump the entire contributor backlog. A restart-orphaned review deserves to be re-driven, not prioritised over work that has waited longer. The repo's ownregate-sort-key:checkcaught exactly this on my first attempt — the guard did its job.Fail-safe throughout: a lookup or enqueue failure logs and continues (a healed row with no re-queue still beats a wedged one, and the remaining rows still need healing), and an unregistered repo logs a named skip rather than enqueueing a job that cannot act.
Tests
4 new cases on the lookup: both fields returned, the
#9499ordering invariant,nullfor an unregistered repo (rather than a bogus id), and a registered repo with no stored PR row still resolving so the pass runs.Full suite 25,453 passed;
regate-sort-key,dead-source-files,dead-exports,dispatch-gate-reasonsgreen.Note
This lands after
orb-v3.6.0-beta.8, so the live ORB still has the gap until the next image. #9863's ledger content-waiver is in the same position — both want the same cut.Closes #9870.