Repository navigation
Conversation
The visible follow-up loop kept polling a merged PR every 30 minutes forever, and every visible-row report or focus sweep restarted it — its state, checks and reviews are final, so all of those requests were pure waste against the GitHub host (the volume that got a GitHub Enterprise deployment's administrators asking questions in stablyai#25746). The loop now ends when the outcome is merged, and budgeted background reports skip re-enqueueing a candidate whose cached state is merged. Manual refreshes, worktree activation and post-push refreshes bypass both gates, so a branch that later resolves to a different, open PR resumes polling the moment anyone actually looks at it. Closed PRs keep the existing 30-minute confirmation poll — they can be reopened. Generated-by: GLM-5.3-Flash (ZCode)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe coordinator skips budgeted background refreshes when the cached PR state is merged. Other refresh reasons continue through the existing queue flow. When a refresh finds a merged PR, the queue drainer resets retry state and stops visible follow-up scheduling. Tests cover closed PR follow-up polling after 30 minutes. Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to This change stops background GitHub polling for merged PRs while keeping manual, activation and post-push refreshes working. Closed, unmerged PRs keep their confirmation poll. No merge-blocking risk was identified. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change reduces automatic requests without adding permissions or endpoints. Explicit refresh, activation and post-push refresh remain available. The main remaining uncertainty is how cached merged status is invalidated when a worktree moves to different work. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation Issue
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
oh no, looking at this! Thank you for discovering |
|
Closing in favor of #25788 — it covers this issue's behavior and a lot more across the polling surface. No hard feelings about the race: the report went up and two fixes ran, that's how discovery goes. One observation for what it's worth: the piece I'd have watched closest in the new policy model is merged PRs stopping the follow-up loop — on the old code, a test here pinned a merged candidate being re-fetched 8 times across a 31-minute window, so if that regression class ever resurfaces, that's its shape. Thanks for the quick turnaround on the report! |
ELI5
Orca keeps asking GitHub about a worktree's PR forever — even after that PR is merged, whose state can never change again. A GitHub Enterprise deployment's administrators flagged the request volume (#25746). This PR stops the background polling the moment a PR is merged; if you refresh manually, activate the worktree, or push to the branch, Orca looks again and resumes polling if there's a live PR to watch.
What Changed
pr-refresh-queue-drainerends when an outcome resolves to a merged PR (previously it re-scheduled every 30 minutes indefinitely, and any scroll/focus report restarted it sooner).enqueuePRRefreshinpr-refresh-coordinatorskips budgeted background reports (visible rows, focus sweeps) for candidates whose cached PR state ismerged, so the loop isn't restarted by scrolling around the sidebar.Why
A merged PR can never reopen and its checks/reviews are final — every background request for it is pure waste, and the volume scales with worktree count (the exact pattern that got an GHES deployment flagged in the report). Merged vs closed are treated differently on purpose: GitHub forbids reopening a merged PR, so hard-stopping is semantically safe there, while a closed PR can reopen and the existing 30-minute poll is the discovery path.
Linked Issue
Fixes #25746 (the merged-polling behavior — the first of the report's four items). The other three (concurrent same-request dedup, a polling on/off setting, GHES-specific throttling) are deliberately not packed into this PR; happy to take them as follow-ups if the maintainers want them.
Visual Proof
N/A for attached media in this environment (headless run). Behavior is pinned by tests: before the fix a merged candidate was fetched 8 times across a 31-minute simulated window; after the fix the follow-up loop ends at the merged outcome (0 further fetches), background re-reports are skipped instead of re-enqueued, and the closed-PR 30-minute confirmation behavior is pinned unchanged.
Testing
Commands actually run locally (macOS): new cases red→green (2 failed / 5 passed before, 7 passed after); 8 adjacent coordinator/queue suites (54 tests); PR client state/visibility/error-classification suites (41 tests); the IPC routing suite (5 tests); the full
src/main/githubdirectory 78 files / 802 tests passed;pnpm tcandpnpm run typecheck:nodeexit 0;oxlint/oxfmt --checkclean on the three touched files. Real GitHub/gh traffic was not exercised — the gates are pinned at the coordinator/queue boundary where the fetch count is asserted.AI Disclosure
Investigation, coding and verification by GLM-5.3-Flash (ZCode agent); orchestrated, reviewed and committed by a main agent with the same model, human overseeing.
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Main-process only; the renderer's runtime-environment direct path has no timer self-loop (5-minute freshness gate, event-driven) and is untouched. SSH-connected worktrees go through the same coordinator (refresh keys are connection-scoped), so the stop applies there identically. Backwards compatible: nothing about stored state or wire shapes changes, and any merged worktree resumes normal polling the first time a manual/activation/post-push refresh resolves an open PR on its branch.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)