fix(queue): cap backlog-convergence re-review attempts per head SHA - #5859
Conversation
sweepRepoBacklogConvergence re-selects any open PR whose public review surface never converged to its current head (lastPublishedSurfaceSha != headSha) -- the same signal the main sweep's outage-repair path already guards with a per-SHA attempt cap. This sweep had no such guard: when a PR's gate-check finalize silently failed while its comment still published, the marker never advanced and this sweep re-dispatched a full agent-regate-pr job for it every ~30 minutes indefinitely. Confirmed live on the three PRs an ops-anomaly detector flagged: the same sticky PR comment was edited 11-100 times over 1.3-23.5 hours, long after the head SHA had stopped changing (in one case, zero pushes for the entire window). Extract the existing repair-attempt-cap check (previously inlined in surfaceRepairPriorityPullNumbers) into isRegateRepairExhausted and share it from both sweeps against the SAME per-(repo, PR, headSha) budget -- deliberately not an independent counter, since both sweeps re-select on the identical signal and would otherwise double the wasted spend the cap exists to prevent. Passing repairHeadSha on backlog-convergence's dispatched jobs reuses the existing execution-time (not dispatch-time) attempt recording, so a deferred or dropped job still doesn't count against the cap.
|
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 #5859 +/- ##
=======================================
Coverage 95.11% 95.12%
=======================================
Files 587 587
Lines 46509 46513 +4
Branches 14870 14871 +1
=======================================
+ Hits 44238 44245 +7
+ Misses 1515 1513 -2
+ Partials 756 755 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-14 20:15:54 UTC
⏸️ Suggested Action - Manual Review Review summary Nits — 5 non-blocking
Concerns raised — review before merging
📋 Copy for AI agents — paste into your coding agent
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory 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://gittensory.aethereal.dev/docs/gittensory-commands 🟩 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.
|
Summary
sweepRepoBacklogConvergencere-selects any open PR whose public review surface never converged to its current head (lastPublishedSurfaceSha != headSha) — the same signal the main sweep's outage-repair path already guards with a per-SHA attempt cap. This sweep had no such guard: when a PR's gate-check finalize silently failed while its comment still published, the marker never advanced and this sweep re-dispatched a fullagent-regate-prjob for it every ~30 minutes indefinitely.surfaceRepairPriorityPullNumbers) intoisRegateRepairExhaustedand shared it from both sweeps against the SAME per-(repo, PR, headSha)budget — deliberately not an independent counter, since both sweeps re-select on the identical signal and would otherwise double the wasted spend the cap exists to prevent. PassingrepairHeadShaon backlog-convergence's dispatched jobs reuses the existing execution-time (not dispatch-time) attempt recording, so a deferred or dropped job still doesn't count against the cap.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally — 853 test files passed, 0 failed (full unsharded run), including the 3 pre-existing#orb-retry-stormregression tests (verifying the extracted helper is behavior-preserving) plus 2 new tests covering the backlog-convergence half: a SHA that already exhausted the shared budget is not re-dispatched, and a fresh candidate is dispatched withrepairHeadShaset and correctly charges the shared budget on execution.npm run test:engine-parity— clean, unaffected (this change doesn't touchpackages/loopover-engine).npm audit --audit-level=moderate— clean, 0 vulnerabilities.npm run test:workers/npm run build:mcp/npm run test:mcp-pack/npm run ui:*— not run, see note below.If any required check was skipped, explain why:
src/queue/processors.tsand its unit tests — no Workers runtime, MCP package, API route, OpenAPI schema, or UI code is touched.Safety
UI Evidence
N/A — no UI/frontend/docs change.
Notes
userContentEdits) before writing the fix, not from the ops-anomaly log alone.