fix(review): coalesce a repeated over-cap sibling wake by head SHA, not just PR number#5485
Conversation
…ot just PR number wakeOverCapSiblingPullRequests dispatched a full agent-regate-pr job (re-run the entire review + gate + comment republish) for every over-cap sibling whenever ANY webhook for the same author recomputed the per-contributor open-PR cap, throttled only by a 60-second coalesce key scoped to the bare PR number -- a window sized for a burst of near-simultaneous CI completions, not a trigger that can recur every few minutes to several hours. Confirmed live: a contributor repeatedly opening (and having auto-closed) near-duplicate PRs re-triggered the SAME sibling's full review republish every time, even though nothing about the sibling itself ever changed -- one PR published 27 redundant review surfaces in 2 hours this way. The coalescing key is now scoped by the sibling's CURRENT head SHA (falling back to the bare-number key on a lookup miss) with a ~30-minute cooldown (reusing AI_REVIEW_NON_CACHEABLE_RETRY_COOLDOWN_MS), mirroring the identical "a new commit resets the guard" idiom the CI-stuck-finalize guard already uses one function up (#orb-ci-stuck-repeat). An unchanged head within the cooldown has nothing new to learn from a fresh full re-review; a genuinely new commit still gets its own fresh wake. Fixes GITTENSORY-1D
|
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 #5485 +/- ##
=======================================
Coverage 94.73% 94.74%
=======================================
Files 561 561
Lines 44794 44796 +2
Branches 14667 14669 +2
=======================================
+ Hits 42437 42440 +3
Misses 1622 1622
+ Partials 735 734 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review result - fixes requiredReview updated: 2026-07-12 23:06:35 UTC
🛑 Suggested Action - Manual Review Review summary Blockers
Nits — 5 non-blocking
Why this is blocked
📋 Copy for AI agents — paste into your coding agentCI checks failing
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 Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Codecov flagged 2 uncovered partials in wakeOverCapSiblingPullRequests (#5385-sentry, GITTENSORY-1D) -- every existing test resolves the sibling's head SHA successfully, so the documented "PR not found locally, fail open to the bare key + 60s window" branch was never exercised.
Summary
Sentry issue GITTENSORY-1D is a deliberate anomaly-detection capture, not a bug in itself — but the specific anomaly it flagged this time was real: "review burst: #5260 published 27 review surfaces in the last 2h — likely a stuck-CI finalize loop or retry storm."
Live GitHub evidence ruled out the obvious suspect (a stuck-CI retry loop on PR #5260's own commit — its CI ran and settled exactly once). The actual driver: the same PR author repeatedly opened (and had auto-closed) five near-duplicate PRs throughout the day. Each episode re-triggers
wakeOverCapSiblingPullRequestsfor the author's other open PRs (including #5260), which enqueues a fullagent-regate-prjob — re-running and republishing the ENTIRE review surface — coalesced only by a 60-second key sized for a burst of near-simultaneous CI completions, not a trigger recurring every 10 minutes to 5+ hours.This is a live sibling of the bug fixed in #3755/9b1cfc9d5 (a durable per-head-SHA guard against redundant re-publishing), which was scoped only to
prReadyForReview's CI-stuck-pending branch and never generalized to this wake path.Changes
wakeOverCapSiblingPullRequests(src/queue/processors.ts) now scopes its coalescing key by the sibling's CURRENT head SHA (not just its bare PR number), with a ~30-minute cooldown (reusing the existingAI_REVIEW_NON_CACHEABLE_RETRY_COOLDOWN_MSprecedent) instead of the 60-secondCI_COALESCE_WINDOW_SECONDSwindow.Test plan
npm run typecheck— cleannpm run test:ci(full local gate, unsharded coverage) — greenFixes GITTENSORY-1D