Skip to content

feat(github): PR auto-refresh cadence setting to cap background PR/checks polling (STA-8667) - #40541

Merged
brennanb2025 merged 67 commits into
mainfrom
AmethystLiang/sta-8667-pr-polling-cap
Nov 14, 2026
Merged

brennanb2025 merged 67 commits into
mainfrom
AmethystLiang/sta-8667-pr-polling-cap

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

A GitHub Enterprise user needed fewer automatic pull request checks. Settings → Source Control now has PR Updates with Automatic, Less often, and Manual, using the approved segmented control, one live helper sentence, and an info tooltip.

  • Automatic keeps the current cadence. Less often uses the existing Reduced cadence (×5). Manual stops routine timer reads while push, explicit refresh, eligible foreground reads and ongoing chat CI watches retain their existing behavior.
  • The selected host owns the preference, shared with its connected clients. Older servers show a disabled control with “Update Orca on to change this”; loading keeps the control disabled with no helper text.
  • Existing saved values are retained. Legacy Minimal appears as Less often and continues at its saved cadence until the user chooses another option.
  • Merged main and reconciled the mobile module moves, async CI watch storage, and queue behavior with the cadence setting.

Tracked in #23311 (STA-8667). Builds on the automatic result sharing and host budget in #42033.

Validation: typecheck through tc-gate; targeted settings, host cadence, watch, restoration, shared-read and foreground-cache tests; light/dark component screenshots including all choices, loading, older server, info tooltip, legacy Minimal and a narrow panel. The mobile renderer suite is left to CI because this checkout lacks its dependencies. Final review and CI results are recorded in the status comment.

Risk: host-wide cadence changes can affect queued reads, retries and shared results. Existing ownership, cadence and fairness regression coverage exercises those seams. Older clients retain their existing behavior. Back out with a plain revert; saved preferences remain intact.

Preserves Jinjing’s original branch history and contributor credit.

Files Added Deleted Net
Test 30 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4990 $\color{#cf222e}{\Huge{\mathbf{−}}}$​32 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4958
Prod 83 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3920 $\color{#cf222e}{\Huge{\mathbf{−}}}$​990 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2930

AmethystLiang added a commit that referenced this pull request Nov 11, 2026
…close the C1 polling gaps (STA-8667)

Review round C1 on #40541 found seven places where the new cadence did not
hold. This settles the contract as one cadence per execution host and fixes
each gap with a regression test:

- The renderer schedules each workspace by the cadence of the host that runs
  its GitHub reads: its own setting for local work, the paired host's setting
  (read on contact, on settingsChanged and from the Settings control) for that
  host's workspaces. A local Off no longer stops a remote Default and the
  reverse. Policy, timers and the checks panel re-plan on any cadence change.
- github.prForBranch and github.prChecks: a paired client's timer reads carry
  reason swr/visible and the host answers them from its last read at its
  cadence; window return, screen open, manual refresh and changed-state reads
  carry foreground/noCache and always reach the provider. Mobile sends the
  same intent for its own timer.
- Off stops ordinary failure retries (main coordinator, renderer scheduler,
  checks detail policy); CI-line watches keep retrying at Minimal.
- Earlier-head CI watches follow the same watch cadence as the current head.
- The paced PR cache identity includes acceptMergedFallbackPR.
@AmethystLiang
AmethystLiang force-pushed the AmethystLiang/sta-8667-pr-polling-cap branch from 4e0a55a to 6284228 Compare November 11, 2026 21:54
@AmethystLiang

Copy link
Copy Markdown
Contributor Author

Closing in favour of an automatic redesign for STA-8667 / #23311: no user-facing cadence setting. Polling will be reduced automatically (shared host result cache, backoff on unchanged PRs, a budget for serve/paired-client reads, rate-limit taken from response headers instead of extra probes), and it covers the desktop app and GitHub Enterprise, not only orca serve. The review findings on this PR (cache identity, retry reconciliation, foreground reads, stale host results) carry over as requirements. The design is in review now; a new PR will link here.

@AmethystLiang

Copy link
Copy Markdown
Contributor Author

Reopening: this PR was closed in favour of an automatic-only redesign, but an enterprise user on a shared GitHub Enterprise Server asked specifically for a configurable refresh interval (see #23311 (comment)). Automatic backoff can still land alongside it, but this setting stays on the table.

@AmethystLiang AmethystLiang reopened this Nov 12, 2026
…und PR/checks polling (STA-8667)

Timed PR, review and checks refreshes were hardcoded (1/2 min visible,
15 min no-review), with no way to slow them on a busy headless `orca serve`
or a shared GitHub Enterprise Server.

Adds `prAutoRefresh: default | reduced | minimal | off` (5x / 10x / no timed
refresh). Selecting a workspace, pushing, returning to the window and manual
refresh still read at once in every mode.

- shared policy scales every timed interval from one process-wide cadence,
  set from settings in main (desktop and serve) and in the renderer
- main re-plans queued visible follow-ups when the cadence changes
- a paired server's cadence also caps clients' timed `github.prForBranch`
  reads (reuses the last answer for the same head) and stretches the hosted
  review branch cache TTLs, so more clients add no GitHub calls
- CI-line watches slow to the minimal cadence instead of stopping when off
- Settings > Git & Source Control gains a host-aware PR Auto-Refresh control
…s and whose host it changes (STA-8667)

UX round UX-I1: the hint under the segmented control states the actual
cadence for the selection, derived from the shared policy, and when a paired
server is the Settings host the control says it applies to that host and every
connected client. Adds a presentational PRAutoRefreshControl with fixtures and
a component test.
…close the C1 polling gaps (STA-8667)

Review round C1 on #40541 found seven places where the new cadence did not
hold. This settles the contract as one cadence per execution host and fixes
each gap with a regression test:

- The renderer schedules each workspace by the cadence of the host that runs
  its GitHub reads: its own setting for local work, the paired host's setting
  (read on contact, on settingsChanged and from the Settings control) for that
  host's workspaces. A local Off no longer stops a remote Default and the
  reverse. Policy, timers and the checks panel re-plan on any cadence change.
- github.prForBranch and github.prChecks: a paired client's timer reads carry
  reason swr/visible and the host answers them from its last read at its
  cadence; window return, screen open, manual refresh and changed-state reads
  carry foreground/noCache and always reach the provider. Mobile sends the
  same intent for its own timer.
- Off stops ordinary failure retries (main coordinator, renderer scheduler,
  checks detail policy); CI-line watches keep retrying at Minimal.
- Earlier-head CI watches follow the same watch cadence as the current head.
- The paced PR cache identity includes acceptMergedFallbackPR.
…s and scope, retry and settings-sync races, focus return under Off, mobile foreground reads (STA-8667)

- github.prChecks: every successful full read (timed, foreground, manual, noCache) is recorded as the host's last answer with start-order protection, so a later timed client never gets an older result back; the paced key now carries the execution scope, review generation and resolved gh read scope like the provider read itself.
- Renderer visible scheduler: a retry armed after a failure is dropped when the owning host's cadence becomes Off and re-timed when it is stretched, instead of firing once under the old cadence.
- Remote host cadence sync: a settingsChanged (or regained contact) during an in-flight settings.get marks it dirty and triggers one trailing read; a slow answer never reverts a value the Settings control wrote or re-adds an unpaired host.
- Checks panel: a focus-only window return (document never hidden) reads once under Off with the usual cooldown and in-flight guards, unless the checks are settled.
- Settings: the remote PR Auto-Refresh control shows the one shared, subscribed copy of the host's setting, so another client's change is reflected while mounted and the displayed option can be chosen back.
- Mobile: a branch read right after the app comes to the foreground is sent as foreground and bypasses the host's 30 s reuse of its own desktop lookup.

Each new test fails without its fix.
…ries on cadence change, window return under Reduced/Minimal, older paired host fallback (STA-8667)
@AmethystLiang
AmethystLiang force-pushed the AmethystLiang/sta-8667-pr-polling-cap branch from 9a02abf to 4a19f56 Compare November 12, 2026 14:49
@AmethystLiang
AmethystLiang marked this pull request as ready for review November 12, 2026 17:06
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The change adds PR auto-refresh cadence settings with Default, Reduced, Minimal, and Off modes. It applies cadence to PR polling, checks reads, hosted-review refresh, watch jobs, and retry scheduling. Renderer settings can read and update local or paired-host cadence values. Mobile reads now carry intent and can preserve cached PR data while scheduling receipt-driven revalidation. Refresh coordination also changes read admission, visibility tracking, result delivery, and retry handling.

Merge Risk: Moderate · previous review 66c7d

This PR adds a PR auto-refresh cadence setting, and several open concerns remain around it. Some cadence changes, window returns and error retries may not behave as the setting describes. Possible typecheck failures and pending CI should also be settled before merge.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description covers the core change well: it explains the new PR Updates setting (Automatic, Less often, Manual), the host ownership model, legacy Minimal handling, older-server behavior, risk, and… Add an ELI5 section in plain language. Replace 'Tracked in #23311' with a 'Fixes #' issue link, or confirm the issue is pre-existing for a maintainer. Attach a before/after pair for the settings UI, or state the screenshots as links, since …
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title names a PR auto-refresh cadence setting that caps background PR/checks polling. The changeset adds this setting (Default, Reduced, Minimal, Off) across settings UI, shared policy, main-proce…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names a PR auto-refresh cadence setting that caps background PR/checks polling. The changeset adds this setting (Default, Reduced, Minimal, Off) across settings UI, shared policy, main-process refresh scheduling, and mobile polling, so the title matches the main change. The title is long (92 characters) and includes a ticket ID, which adds noise but does not make it inaccurate.

Full details: Description check

Explanation

The description covers the core change well: it explains the new PR Updates setting (Automatic, Less often, Manual), the host ownership model, legacy Minimal handling, older-server behavior, risk, and a rollback path. It also includes validation notes and an issue reference. It does not follow the template in several places. The ELI5 section is missing. The Linked Issue section uses 'Tracked in #23311' rather than a 'Fixes #' closing reference, and the template requires an actual issue link. The Visual Proof section gives no before/after pair, although the description says screenshots were captured. The Testing checklist boxes are not ticked, and the test-anti-pattern check is not addressed. The Risk level is not set. The AI Disclosure section is not addressed, and the Agent skill upstream boundary checkbox is not marked. The Checklist is not ticked.

Resolution

Add an ELI5 section in plain language. Replace 'Tracked in #23311' with a 'Fixes #' issue link, or confirm the issue is pre-existing for a maintainer. Attach a before/after pair for the settings UI, or state the screenshots as links, since the template requires a switchable before/after for UI changes. Tick the Testing checkboxes that apply, and confirm the new tests fail without the change. Set the Risk Level to Low, Medium, or High. Fill in or mark N/A the AI Disclosure section, the Agent skill upstream boundary item, and the Checklist items. The 'Validation' paragraph should name the platforms actually tested, since the description says the packed launcher, WSL, SSH, and physical devices were not tested.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9e36085b-36ca-4014-bbe7-cfda88823a11
Commits

Reviewing files that changed from the base of the PR and between 10e6137 and 66c7d06.

Files selected for processing: 4

  • mobile/src/source-control/review/pr-for-branch-revalidation.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-alias-coalescing.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-quiet-policy.perf.test.ts
  • tests/e2e/pr-auto-refresh-setting-order.unit.test.ts
Files skipped from review as they are similar to previous changes: 1

  • src/main/github/pull-requests/refresh/pr-refresh-quiet-policy.perf.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 13

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8813cf01-cf2b-42b6-9f76-621c5b5bdd78
Commits

Reviewing files that changed from the base of the PR and between 1bd6d7a and 4a19f56.

Files selected for processing: 77

  • mobile/src/components/pr-sidebar/use-mobile-pr-polling.ts
  • mobile/src/query/host-read-intent.test.ts
  • mobile/src/query/host-read-intent.ts
  • mobile/src/query/orca-query-provider.tsx
  • mobile/src/source-control/mobile-source-control-settings-operations.ts
  • mobile/src/source-control/mobile-source-control-settings.ts
  • mobile/src/source-control/review/github-pr-rpc.ts
  • mobile/src/source-control/review/mobile-pr-queries.ts
  • mobile/src/source-control/review/mobile-pr-sidebar-state.ts
  • src/main/github/client/check/pr-checks-last-outcome.ts
  • src/main/github/client/lookup/pr-for-branch-outcome.ts
  • src/main/github/client/lookup/pr-last-outcome.test.ts
  • src/main/github/client/lookup/pr-last-outcome.ts
  • src/main/github/pr-auto-refresh-cadence-sync.ts
  • src/main/github/pr-refresh-candidate-policy.ts
  • src/main/github/pr-refresh-coordinator-auto-refresh-cadence.test.ts
  • src/main/github/pr-refresh-coordinator.ts
  • src/main/github/pr-refresh-error-retry-retiming.ts
  • src/main/github/pr-refresh-queue-drainer.ts
  • src/main/github/pr-refresh-queue.ts
  • src/main/github/pr-refresh-retry-state.ts
  • src/main/github/pr-refresh-watch-jobs-cadence.test.ts
  • src/main/github/pr-refresh-watch-jobs.ts
  • src/main/github/pr-watch/pr-earlier-head-jobs-cadence.test.ts
  • src/main/github/pr-watch/pr-earlier-head-jobs.ts
  • src/main/runtime/client/settings/runtime-client-settings-shape.ts
  • src/main/runtime/client/settings/runtime-client-settings.ts
  • src/main/runtime/construction/runtime-store-contract.ts
  • src/main/runtime/integrations/github/runtime-github-review-query-commands-checks-cap.test.ts
  • src/main/runtime/integrations/github/runtime-github-review-query-commands.ts
  • src/main/runtime/integrations/reviews/runtime-hosted-review-commands.ts
  • src/main/runtime/integrations/reviews/runtime-hosted-review-pr-reuse.test.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/runtime/rpc/methods/source-control/github/github-pull-request-methods.ts
  • src/main/source-control/hosted-review-branch-cache.test.ts
  • src/main/source-control/hosted-review-branch-cache.ts
  • src/renderer/src/app-shell/ActiveWorkspaceSyncGate.tsx
  • src/renderer/src/app-shell/use-remote-host-pr-auto-refresh-cadence.ts
  • src/renderer/src/app-shell/use-visible-hosted-review-refresh.ts
  • src/renderer/src/app-shell/use-visible-review-refresh-reporting.ts
  • src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-detail-timer-cadence.test.tsx
  • src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-detail-timer.ts
  • src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-polling.tsx
  • src/renderer/src/components/settings/page/settings-git-task-section-renderers.tsx
  • src/renderer/src/components/settings/source-control/GitProviderApiBudgetPane.tsx
  • src/renderer/src/components/settings/source-control/PRAutoRefreshControl.test.tsx
  • src/renderer/src/components/settings/source-control/PRAutoRefreshControl.tsx
  • src/renderer/src/components/settings/source-control/PRAutoRefreshSetting.fixture.tsx
  • src/renderer/src/components/settings/source-control/PRAutoRefreshSetting.test.tsx
  • src/renderer/src/components/settings/source-control/PRAutoRefreshSetting.tsx
  • src/renderer/src/components/settings/source-control/git-provider-api-budget-search.ts
  • src/renderer/src/components/settings/source-control/pr-auto-refresh-search.ts
  • src/renderer/src/components/sidebar/workspace-card/review/workspace-reference-refresh-targets.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/window-activity/window-visibility-timeout-poller.test.ts
  • src/renderer/src/lib/window-activity/window-visibility-timeout-poller.ts
  • src/renderer/src/runtime/rpc/subscriptions/runtime-client-events.ts
  • src/renderer/src/store/github/checks/check-actions.ts
  • src/renderer/src/store/github/github-slice-contract.ts
  • src/renderer/src/store/github/pull-requests/pull-request-execution.ts
  • src/renderer/src/store/github/refresh/pr-auto-refresh-cadence-observer.test.ts
  • src/renderer/src/store/github/refresh/pr-auto-refresh-cadence-observer.ts
  • src/renderer/src/store/github/refresh/remote-host-pr-auto-refresh-cadence-sync.test.ts
  • src/renderer/src/store/github/refresh/remote-host-pr-auto-refresh-cadence-sync.ts
  • src/renderer/src/store/github/refresh/remote-host-pr-auto-refresh-cadence.ts
  • src/renderer/src/store/slices/hosted-review/refresh/visible-hosted-review-refresh-scheduler.test.ts
  • src/renderer/src/store/slices/hosted-review/refresh/visible-hosted-review-refresh-scheduler.ts
  • src/renderer/src/store/slices/hosted-review/refresh/visible-hosted-review-refresh-targets.ts
  • src/renderer/src/store/store-observer-installers.ts
  • src/shared/default-global-settings.ts
  • src/shared/github/checks-detail-polling-policy-cadence.test.ts
  • src/shared/github/checks-detail-polling-policy.ts
  • src/shared/global-settings-base.ts
  • src/shared/review-refresh-policy.test.ts
  • src/shared/review-refresh-policy.ts
  • src/shared/rpc-contract/client-settings-params.ts
  • src/shared/rpc-contract/github-pull-request-params.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@AmethystLiang

Copy link
Copy Markdown
Contributor Author

Closing. Per the owner's decision, STA-8667 is being solved without a user-facing setting: background PR/checks polling will be optimized automatically (a shared host result cache, backoff on unchanged results, and serve reads going through the existing budget). That design is in review, and a new PR will follow. The correctness findings from this PR's reviews carry over as requirements.

@AmethystLiang

Copy link
Copy Markdown
Contributor Author

Reopening: the owner decided this PR must stay open because an enterprise user on a shared GitHub Enterprise Server asked for the interval setting directly (#23311 (comment)). The automatic reductions can land alongside it.

@AmethystLiang AmethystLiang reopened this Nov 13, 2026
@brennanb2025

Copy link
Copy Markdown
Contributor

Taking over this handed-off PR in place, keeping Jinjing’s authorship and contribution credit. The interval setting stays as requested for shared GitHub Enterprise servers. I will first land automatic reductions to duplicate and idle PR polling, then bring this original branch onto that shared mechanism and finish validation, including orca serve. No merge is being requested yet.

brennanb2025 and others added 4 commits November 13, 2026 04:08
Reuse exact completed results for automatic refreshes, back off unchanged
settled pull requests, and route server revalidation through the existing
host budget while preserving foreground reads and older clients.

Co-authored-by: Jinjing <[email protected]>
@brennanb2025

brennanb2025 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

READY TO MERGE — final-head CI and readiness checks pass. Published head 1e78480103f4e0c75ecf8ea62846a14262e55658 includes the authorized one-time main merge and two test-only type corrections. The continuing Codex reviewer approved both deltas; no production behavior or assertions changed in the final correction. The independent pair, performance screen/review and scoped QA evidence below carry. brennan-ready --force --pr 40541 returned READY for this head, carrying scoped real QA through qa_head=. No merge was performed.

What users get: PR Auto-Refresh in Source Control settings offers Default, Reduced ×5, Minimal ×10 and Off for the selected host. Connected clients share the saved choice. Initial discovery, eligible foreground returns, explicit refresh and post-push reads stay available; CI watches continue at Minimal under Off. #42033’s automatic reductions have landed. This preserves Amethyst/Jinjing’s original branch, history and co-author credit.

What was repaired: every shown checkout receives the shared result; a captured post-push action survives another checkout’s routine work during quota waiting; foreground discovery uses Default freshness while preserving a genuine GitHub Retry-After; phone data is retained only for the current PR link. Obsolete failures release their ownership even when newer work is queued.

Verified: 47 host/renderer/runtime checks passed on the final production repair, eight mobile loader cases passed on their unchanged source, and the corrected live two-window quota case passed separately. Both the quota case and real runtime/store/target/429-parser hold case failed against the corresponding earlier production code before passing with the repair. Final commits only corrected renderer liveness and fake-clock intervals; the assertions and production bytes carry.

Benchmark: 14 PR rows, two clients, 30 simulated minutes through the production fixture: 225 → 95 provider reads (57.8% fewer). Earlier after-result: 95; final production repair: 95, so 0% regression. Snapshot requests: 442; no drain after hiding; CI-result application about 54 seconds in this workload. These are request counts, not a CPU measurement. The other cadence rows retain earlier evidence; no large matrix was repeated.

Review and checks: the continuing Claude Opus-medium and Codex-high pair approved the behavioral repairs. Both initial performance screens and the separate bounded-work review are recorded. The final required changed check was invoked before pushing: four checks passed; 36 hit time/admission limits, including unadmitted type/unit checks. Quality output reported zero new findings before timing out. Normal commit hooks passed. This does not establish a full local pass. The final-head CI watcher exited 0; all 58 reported contexts are complete with no failures. Executed passes include Mobile verify, static/type checks, dependency isolation, all twelve unit shards, changed E2E specs, packaging, persistence and all three WSL distro jobs. Skipped contexts are not claimed as executed proof.

Real-host evidence carried for unchanged flows: Linux public orca serve with two paired web clients exercised shared/live/durable settings, Off/manual behavior and responsiveness during a held read. A separate saved-Reduced graceful restart reused a snapshot at about 104 seconds with no later settings write or provider start. The four final-copy screenshot assets in the description were byte-matched to their Linux captures.

Thread dispositions: all 30 discussions have individual source/evidence dispositions. Four require an explanation rather than a source fix here: an unchanged-main WSL event-ordering bug reported to perf-guard, two duplicate unconfirmed cadence-admission concerns, and unchanged main priority for unselected reference reads under the existing owner ruling. These are not called fixed. Earlier required proof was retained where blanket deletion would remove a supported contract.

Known nonblocking cases: several aliases of one PR can reset the shared retry count on cadence change; queued retries and exact-request gates remain. Returning to a window can earn a Default-aged read even while another window shows the PR; reads still share the host budget. An empty mobile result can remain until its retry, and existing absolute host timestamps retain their clock-skew limitation.

UNTESTED: packed/server-only orcad launcher, live Electron/desktop IPC, WSL, SSH, physical macOS/Windows/phone, and live GHES. Older-host handling has contracts and a fixture. No CPU percentage or physical-host pass is claimed; current-head CI is green.

For Brennan’s review: screenshots in the description cover Default/light, Reduced/dark, an unsupported older host and German fallback copy. Three source spots: host cadence restoration, foreground/provider hold scheduling, and runtime outcome propagation.

Evidence: ~/orca-qa/serve-pr-polling/phase2-ledger.md, hold-final-evidence.md, CHILD-FINAL-30-CLOSURE.json, and final-evidence-addendum.md. Source approval, executed proof, local resource limits and successful CI are recorded separately.

Evidence carry: real public-serve/saved-Reduced startup QA remains on 02a9d0db5463e9b21533d7acca666e718351ccd3; those settings/startup flows are unchanged. Subsequent PR behavior changes are tests-row flows: result identity/publication and alias restoration (host/coordinator integration proofs), foreground/default freshness and Retry-After scheduling (renderer/runtime proofs), and mobile receipt retention (loader proofs). The final two commits before the main merge only strengthen the live-window fixture and use fixed fake-clock intervals. Merge 787d257108875d5c867fefb0c3490577280829b5 preserves incoming main and the PR policy, with its one resolution checked by the continuing Codex reviewer. Screenshots cover unchanged setting/copy states.

QA evidence: public Linux orca serve, two paired web clients and saved-Reduced graceful restart; reports startup5418-report.md, startup5418-author-verification.md and final-evidence-addendum.md in the lane evidence folder.

Final CI-only carry: 1e78480103f4e0c75ecf8ea62846a14262e55658 adds the existing optional userRefresh parameter to the test mock signature and keeps the mobile receipt discriminator literal. No runtime values, assertions or coverage change. Narrow continuing Codex receipt: MERGE-CI-TYPES-codex.md; Claude behavioral evidence carries under the pure CI rule. GitHub final-state verification found base main, non-draft, CLEAN, all 30 discussions resolved and no failed or pending checks.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 11

Nitpick comments: 4

src/main/runtime/integrations/reviews/hosted-pr-selected-demand.test.ts: 1

82-93: Trivial · Maintainability & Code Quality · Quick win

Remove the parser-only compatibility test.

This case tests Zod parsing and unknown-field stripping through a schema constructed with .omit(). Remove this case and retain the request-delivery coverage.

Based on learnings, the repository rule prohibits testing “third-party libraries”; its anti-pattern guide also excludes schema-value tests. (raw.githubusercontent.com)

Source: Learnings

src/main/runtime/integrations/reviews/runtime-hosted-pr-cadence.test.ts: 1

35-35: Trivial · Maintainability & Code Quality · Quick win

Keep public-result assertions instead of provider-read counts.

These assertions measure internal read budgets. Line 35 also derives its expected count from the mock itself. Remove these count assertions and retain the snapshot, retry-metadata, and recovery assertions.

Based on learnings, the repository rule prohibits “timing, or work counts” and expected values computed from mocks. (raw.githubusercontent.com)

Also applies to: 62-62, 85-85, 121-121, 129-129, 131-131

Source: Learnings

src/main/runtime/integrations/reviews/runtime-hosted-pr-owner-delivery.test.ts: 1

97-97: Trivial · Maintainability & Code Quality · Quick win

Remove the private backoff-state assertion.

_getPRRefreshErrorBackoffCountForTests() couples this case to internal retry storage. Remove this assertion and retain the reply and observer checks.

Based on learnings, the repository rule prohibits testing “private state”; the anti-pattern guide explicitly excludes *ForTests() access. (raw.githubusercontent.com)

Source: Learnings

src/shared/runtime-rpc-subscription-queue.test.ts: 1

49-49: Trivial · Maintainability & Code Quality · Quick win

Use a single-slot pool to verify early release.

The default timed queue has two slots. With one pending subscription, 'next' can finish without releasing that subscription's slot. This test can therefore pass when early release is broken. Use new RuntimeRpcCallQueuePool(1) so 'next' must wait for complete() to release admission. (raw.githubusercontent.com)

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 38d9746b-6f2b-4be6-b921-4c5813986efe
Commits

Reviewing files that changed from the base of the PR and between 4a19f56 and 7e44a7f.

Files selected for processing: 131

  • mobile/src/components/pr-sidebar/use-mobile-pr-polling-revalidation.test.ts
  • mobile/src/components/pr-sidebar/use-mobile-pr-polling.ts
  • mobile/src/query/host-query.ts
  • mobile/src/query/host-read-intent.test.ts
  • mobile/src/query/host-read-intent.ts
  • mobile/src/source-control/review/github-pr-read-reply-schema.ts
  • mobile/src/source-control/review/github-pr-rpc.ts
  • mobile/src/source-control/review/mobile-pr-queries.ts
  • mobile/src/source-control/review/mobile-pr-revalidation.test.ts
  • mobile/src/source-control/review/mobile-pr-sidebar-state.ts
  • mobile/src/source-control/review/pr-for-branch-revalidation.ts
  • mobile/src/source-control/settings/mobile-source-control-settings-operations.ts
  • mobile/src/source-control/settings/mobile-source-control-settings.ts
  • src/main/github/accounts/github-project-account.ts
  • src/main/github/client/check/get-pr-checks.ts
  • src/main/github/client/check/pr-checks-last-outcome.ts
  • src/main/github/client/lookup/pr-branch-read-resources.ts
  • src/main/github/client/lookup/pr-for-branch-outcome.ts
  • src/main/github/client/lookup/pr-last-outcome.ts
  • src/main/github/client/lookup/pr-quiet-policy-evidence.ts
  • src/main/github/client/lookup/pr-read-identity.ts
  • src/main/github/client/lookup/pull-request-lookup-data.ts
  • src/main/github/pr-watch/pr-earlier-head-jobs-cadence.test.ts
  • src/main/github/pr-watch/pr-earlier-head-jobs.ts
  • src/main/github/pr-watch/pr-watch-service.ts
  • src/main/github/pull-requests/refresh/hosted-pr-read-jobs.ts
  • src/main/github/pull-requests/refresh/hosted-pr-read-settlement.ts
  • src/main/github/pull-requests/refresh/pr-auto-refresh-cadence-sync.ts
  • src/main/github/pull-requests/refresh/pr-refresh-admission.ts
  • src/main/github/pull-requests/refresh/pr-refresh-candidate-policy-cadence.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-candidate-policy.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-active-visible-priority.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-alias-coalescing.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-auto-refresh-cadence.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-cache-follow-up.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-completion-order.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-foreground-cache.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-local-delivery.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-restoration.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-test-mocks.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-wsl-stopped-distro.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator.ts
  • src/main/github/pull-requests/refresh/pr-refresh-error-retry-retiming.ts
  • src/main/github/pull-requests/refresh/pr-refresh-event-publisher.ts
  • src/main/github/pull-requests/refresh/pr-refresh-immediate-read.ts
  • src/main/github/pull-requests/refresh/pr-refresh-local-delivery.ts
  • src/main/github/pull-requests/refresh/pr-refresh-pacing.ts
  • src/main/github/pull-requests/refresh/pr-refresh-queue-drainer.ts
  • src/main/github/pull-requests/refresh/pr-refresh-queue-growth-bound.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-queue-scheduler.ts
  • src/main/github/pull-requests/refresh/pr-refresh-queue.ts
  • src/main/github/pull-requests/refresh/pr-refresh-quiet-policy.perf.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-request-merge.ts
  • src/main/github/pull-requests/refresh/pr-refresh-retry-state.ts
  • src/main/github/pull-requests/refresh/pr-refresh-visibility.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-visibility.ts
  • src/main/github/pull-requests/refresh/pr-refresh-watch-jobs-cadence.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-watch-jobs.ts
  • src/main/github/repositories/github-repository-identity.ts
  • src/main/ipc/runtime-environments/requests/runtime-environment-call-queue.ts
  • src/main/ipc/runtime-environments/requests/runtime-environment-subscription-routing.ts
  • src/main/ipc/runtime-environments/requests/runtime-environment-transport-routing.ts
  • src/main/ipc/runtime-environments/runtime-environment-call-queue.test.ts
  • src/main/ipc/runtime-environments/subscriptions/runtime-environments-subscription-lifecycle.test.ts
  • src/main/ipc/source-control/github-pr-refresh-handlers.ts
  • src/main/runtime/construction/runtime-store-contract.ts
  • src/main/runtime/integrations/github/runtime-github-review-query-commands-checks-cap.test.ts
  • src/main/runtime/integrations/github/runtime-github-review-query-commands.ts
  • src/main/runtime/integrations/reviews/hosted-pr-producer-settlement-test-cases.ts
  • src/main/runtime/integrations/reviews/hosted-pr-selected-demand.test.ts
  • src/main/runtime/integrations/reviews/runtime-hosted-pr-cadence.test.ts
  • src/main/runtime/integrations/reviews/runtime-hosted-pr-deadlines.test.ts
  • src/main/runtime/integrations/reviews/runtime-hosted-pr-owner-delivery.test.ts
  • src/main/runtime/integrations/reviews/runtime-hosted-pr-snapshot-test-harness.ts
  • src/main/runtime/integrations/reviews/runtime-hosted-pr-snapshots.test.ts
  • src/main/runtime/integrations/reviews/runtime-hosted-review-commands.ts
  • src/main/runtime/integrations/reviews/runtime-hosted-review-pr-reuse.test.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/runtime/rpc/methods/source-control/github/github-pull-request-methods.ts
  • src/main/source-control/hosted-review-branch-cache.test.ts
  • src/preload/api/github/github-pull-request-api.ts
  • src/renderer/src/app-shell/use-visible-hosted-review-refresh.ts
  • src/renderer/src/app-shell/use-visible-review-refresh-reporting.ts
  • src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-detail-timer-cadence.test.tsx
  • src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-detail-timer.ts
  • src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-return-cache.test.tsx
  • src/renderer/src/components/settings/page/settings-git-task-section-renderers.tsx
  • src/renderer/src/components/settings/source-control/PRAutoRefreshControl.test.tsx
  • src/renderer/src/components/settings/source-control/PRAutoRefreshSetting.test.tsx
  • src/renderer/src/components/settings/source-control/PRAutoRefreshSetting.tsx
  • src/renderer/src/components/settings/source-control/pr-auto-refresh-search.ts
  • src/renderer/src/components/sidebar/workspace-card/review/workspace-reference-refresh-targets.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/window-activity/window-visibility-timeout-poller.ts
  • src/renderer/src/store/github/checks/check-actions.ts
  • src/renderer/src/store/github/github-slice-contract.ts
  • src/renderer/src/store/github/pull-requests/github-pr-request-lifetime.test.ts
  • src/renderer/src/store/github/pull-requests/pull-request-actions.ts
  • src/renderer/src/store/github/pull-requests/pull-request-execution.ts
  • src/renderer/src/store/github/refresh/refresh-event-actions.ts
  • src/renderer/src/store/github/refresh/remote-host-pr-auto-refresh-cadence-sync.test.ts
  • src/renderer/src/store/github/refresh/remote-host-pr-auto-refresh-cadence-sync.ts
  • src/renderer/src/store/github/refresh/remote-host-pr-auto-refresh-cadence.ts
  • src/renderer/src/store/github/requests/request-coordination.ts
  • src/renderer/src/store/slices/hosted-review/refresh/owning-host-cadence-replan.ts
  • src/renderer/src/store/slices/hosted-review/refresh/visible-hosted-review-refresh-scheduler.test.ts
  • src/renderer/src/store/slices/hosted-review/refresh/visible-hosted-review-refresh-scheduler.ts
  • src/renderer/src/store/slices/hosted-review/refresh/visible-hosted-review-refresh-targets.ts
  • src/renderer/src/store/store-observer-installers.ts
  • src/renderer/src/web/preload-api/web-runtime-calls-connection-pin.test.ts
  • src/renderer/src/web/preload-api/web-runtime-calls.ts
  • src/renderer/src/web/preload-api/web-runtime-environments-api.ts
  • src/renderer/src/web/preload-api/web-runtime-pr-subscription-queue.test.ts
  • src/renderer/src/web/preload-api/web-runtime-subscription.ts
  • src/shared/default-global-settings.ts
  • src/shared/github/checks/checks-detail-polling-policy-cadence.test.ts
  • src/shared/github/checks/checks-detail-polling-policy.ts
  • src/shared/github/pull-requests/refresh/pr-quiet-refresh.ts
  • src/shared/github/pull-requests/refresh/pull-request-refresh-types.ts
  • src/shared/review-refresh-policy.test.ts
  • src/shared/review-refresh-policy.ts
  • src/shared/rpc-contract/client-ui/client-settings-params.ts
  • src/shared/rpc-contract/github/github-pull-request-params.ts
  • src/shared/runtime-rpc-call-queue.test.ts
  • src/shared/runtime-rpc-call-queue.ts
  • src/shared/runtime-rpc-subscription-queue.test.ts
  • src/shared/runtime-rpc-subscription-queue.ts
  • tests/e2e/github-pr-hosted-receipt-loop.unit.test.ts
  • tests/e2e/pr-auto-refresh-setting-order.unit.test.ts
  • tests/e2e/pr-refresh-actual-completion.unit.test.ts
  • tests/e2e/runtime-hosted-pr-snapshots-perf.unit.test.ts
Files skipped from review as they are similar to previous changes: 2

  • src/renderer/src/i18n/locales/en.json
  • src/shared/default-global-settings.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (3)

Major · Remove the internal work-count assertions. · pr-refresh-quiet-policy.perf.test.ts:113-116

src/main/github/pull-requests/refresh/pr-refresh-quiet-policy.perf.test.ts:113-116
Major · Maintainability & Code Quality · Quick win

Remove the internal work-count assertions.

These assertions make private discovery and inventory call counts part of the test contract. Remove the work-count scenarios and their counting helpers. Preserve the account-change correctness scenario.

Based on learnings, repository rules say: “Never test … timing, or work counts” and “Perf changes get correctness tests only.”

Also applies to: 239-242

Source: Learnings

Major · Move this pure-store case to the owning store… · pr-refresh-actual-completion.unit.test.ts:370

tests/e2e/pr-refresh-actual-completion.unit.test.ts:370
Major · Maintainability & Code Quality · Quick win

Move this pure-store case to the owning store suite.

This case calls applyGitHubPRRefreshEvent directly and checks store state. It does not exercise IPC or Electron lifecycle behavior. Move it to src/renderer/src/store/slices/*.test.ts and use createTestAppStore() instead of the partial integration fixture. (raw.githubusercontent.com)

As per coding guidelines, “Test pure store logic in src/renderer/src/store/slices/*.test.ts with createTestAppStore().”

Source: Coding guidelines

Major · Remove this work-count benchmark from the… · runtime-hosted-pr-snapshots-perf.unit.test.ts:221

tests/e2e/runtime-hosted-pr-snapshots-perf.unit.test.ts:221
Major · Maintainability & Code Quality · Quick win

Remove this work-count benchmark from the unit-test suite.

This assertion caps internal provider starts. The later assertion also caps total reads. These are work-count checks, not output-correctness checks. Move the measurements to a diagnostic script rather than keeping this benchmark as a unit-test gate. (raw.githubusercontent.com)

Based on learnings, tests must not count internal work: “Perf changes get correctness tests only.” The reviewed repository instructions retain this rule. (raw.githubusercontent.com)

Source: Learnings

Nitpick comments: 4

src/main/runtime/integrations/reviews/hosted-pr-selected-demand.test.ts: 1

82-93: Trivial · Maintainability & Code Quality · Quick win

Remove the parser-only compatibility test.

This case tests Zod parsing and unknown-field stripping through a schema constructed with .omit(). Remove this case and retain the request-delivery coverage.

Based on learnings, the repository rule prohibits testing “third-party libraries”; its anti-pattern guide also excludes schema-value tests. (raw.githubusercontent.com)

Source: Learnings

src/main/runtime/integrations/reviews/runtime-hosted-pr-cadence.test.ts: 1

35-35: Trivial · Maintainability & Code Quality · Quick win

Keep public-result assertions instead of provider-read counts.

These assertions measure internal read budgets. Line 35 also derives its expected count from the mock itself. Remove these count assertions and retain the snapshot, retry-metadata, and recovery assertions.

Based on learnings, the repository rule prohibits “timing, or work counts” and expected values computed from mocks. (raw.githubusercontent.com)

Also applies to: 62-62, 85-85, 121-121, 129-129, 131-131

Source: Learnings

src/main/runtime/integrations/reviews/runtime-hosted-pr-owner-delivery.test.ts: 1

97-97: Trivial · Maintainability & Code Quality · Quick win

Remove the private backoff-state assertion.

_getPRRefreshErrorBackoffCountForTests() couples this case to internal retry storage. Remove this assertion and retain the reply and observer checks.

Based on learnings, the repository rule prohibits testing “private state”; the anti-pattern guide explicitly excludes *ForTests() access. (raw.githubusercontent.com)

Source: Learnings

src/shared/runtime-rpc-subscription-queue.test.ts: 1

49-49: Trivial · Maintainability & Code Quality · Quick win

Use a single-slot pool to verify early release.

The default timed queue has two slots. With one pending subscription, 'next' can finish without releasing that subscription's slot. This test can therefore pass when early release is broken. Use new RuntimeRpcCallQueuePool(1) so 'next' must wait for complete() to release admission. (raw.githubusercontent.com)

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 38d9746b-6f2b-4be6-b921-4c5813986efe
Commits

Reviewing files that changed from the base of the PR and between 4a19f56 and 7e44a7f.

Files selected for processing: 131

  • mobile/src/components/pr-sidebar/use-mobile-pr-polling-revalidation.test.ts
  • mobile/src/components/pr-sidebar/use-mobile-pr-polling.ts
  • mobile/src/query/host-query.ts
  • mobile/src/query/host-read-intent.test.ts
  • mobile/src/query/host-read-intent.ts
  • mobile/src/source-control/review/github-pr-read-reply-schema.ts
  • mobile/src/source-control/review/github-pr-rpc.ts
  • mobile/src/source-control/review/mobile-pr-queries.ts
  • mobile/src/source-control/review/mobile-pr-revalidation.test.ts
  • mobile/src/source-control/review/mobile-pr-sidebar-state.ts
  • mobile/src/source-control/review/pr-for-branch-revalidation.ts
  • mobile/src/source-control/settings/mobile-source-control-settings-operations.ts
  • mobile/src/source-control/settings/mobile-source-control-settings.ts
  • src/main/github/accounts/github-project-account.ts
  • src/main/github/client/check/get-pr-checks.ts
  • src/main/github/client/check/pr-checks-last-outcome.ts
  • src/main/github/client/lookup/pr-branch-read-resources.ts
  • src/main/github/client/lookup/pr-for-branch-outcome.ts
  • src/main/github/client/lookup/pr-last-outcome.ts
  • src/main/github/client/lookup/pr-quiet-policy-evidence.ts
  • src/main/github/client/lookup/pr-read-identity.ts
  • src/main/github/client/lookup/pull-request-lookup-data.ts
  • src/main/github/pr-watch/pr-earlier-head-jobs-cadence.test.ts
  • src/main/github/pr-watch/pr-earlier-head-jobs.ts
  • src/main/github/pr-watch/pr-watch-service.ts
  • src/main/github/pull-requests/refresh/hosted-pr-read-jobs.ts
  • src/main/github/pull-requests/refresh/hosted-pr-read-settlement.ts
  • src/main/github/pull-requests/refresh/pr-auto-refresh-cadence-sync.ts
  • src/main/github/pull-requests/refresh/pr-refresh-admission.ts
  • src/main/github/pull-requests/refresh/pr-refresh-candidate-policy-cadence.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-candidate-policy.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-active-visible-priority.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-alias-coalescing.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-auto-refresh-cadence.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-cache-follow-up.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-completion-order.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-foreground-cache.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-local-delivery.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-restoration.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-test-mocks.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-wsl-stopped-distro.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator.ts
  • src/main/github/pull-requests/refresh/pr-refresh-error-retry-retiming.ts
  • src/main/github/pull-requests/refresh/pr-refresh-event-publisher.ts
  • src/main/github/pull-requests/refresh/pr-refresh-immediate-read.ts
  • src/main/github/pull-requests/refresh/pr-refresh-local-delivery.ts
  • src/main/github/pull-requests/refresh/pr-refresh-pacing.ts
  • src/main/github/pull-requests/refresh/pr-refresh-queue-drainer.ts
  • src/main/github/pull-requests/refresh/pr-refresh-queue-growth-bound.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-queue-scheduler.ts
  • src/main/github/pull-requests/refresh/pr-refresh-queue.ts
  • src/main/github/pull-requests/refresh/pr-refresh-quiet-policy.perf.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-request-merge.ts
  • src/main/github/pull-requests/refresh/pr-refresh-retry-state.ts
  • src/main/github/pull-requests/refresh/pr-refresh-visibility.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-visibility.ts
  • src/main/github/pull-requests/refresh/pr-refresh-watch-jobs-cadence.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-watch-jobs.ts
  • src/main/github/repositories/github-repository-identity.ts
  • src/main/ipc/runtime-environments/requests/runtime-environment-call-queue.ts
  • src/main/ipc/runtime-environments/requests/runtime-environment-subscription-routing.ts
  • src/main/ipc/runtime-environments/requests/runtime-environment-transport-routing.ts
  • src/main/ipc/runtime-environments/runtime-environment-call-queue.test.ts
  • src/main/ipc/runtime-environments/subscriptions/runtime-environments-subscription-lifecycle.test.ts
  • src/main/ipc/source-control/github-pr-refresh-handlers.ts
  • src/main/runtime/construction/runtime-store-contract.ts
  • src/main/runtime/integrations/github/runtime-github-review-query-commands-checks-cap.test.ts
  • src/main/runtime/integrations/github/runtime-github-review-query-commands.ts
  • src/main/runtime/integrations/reviews/hosted-pr-producer-settlement-test-cases.ts
  • src/main/runtime/integrations/reviews/hosted-pr-selected-demand.test.ts
  • src/main/runtime/integrations/reviews/runtime-hosted-pr-cadence.test.ts
  • src/main/runtime/integrations/reviews/runtime-hosted-pr-deadlines.test.ts
  • src/main/runtime/integrations/reviews/runtime-hosted-pr-owner-delivery.test.ts
  • src/main/runtime/integrations/reviews/runtime-hosted-pr-snapshot-test-harness.ts
  • src/main/runtime/integrations/reviews/runtime-hosted-pr-snapshots.test.ts
  • src/main/runtime/integrations/reviews/runtime-hosted-review-commands.ts
  • src/main/runtime/integrations/reviews/runtime-hosted-review-pr-reuse.test.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/runtime/rpc/methods/source-control/github/github-pull-request-methods.ts
  • src/main/source-control/hosted-review-branch-cache.test.ts
  • src/preload/api/github/github-pull-request-api.ts
  • src/renderer/src/app-shell/use-visible-hosted-review-refresh.ts
  • src/renderer/src/app-shell/use-visible-review-refresh-reporting.ts
  • src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-detail-timer-cadence.test.tsx
  • src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-detail-timer.ts
  • src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-return-cache.test.tsx
  • src/renderer/src/components/settings/page/settings-git-task-section-renderers.tsx
  • src/renderer/src/components/settings/source-control/PRAutoRefreshControl.test.tsx
  • src/renderer/src/components/settings/source-control/PRAutoRefreshSetting.test.tsx
  • src/renderer/src/components/settings/source-control/PRAutoRefreshSetting.tsx
  • src/renderer/src/components/settings/source-control/pr-auto-refresh-search.ts
  • src/renderer/src/components/sidebar/workspace-card/review/workspace-reference-refresh-targets.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/window-activity/window-visibility-timeout-poller.ts
  • src/renderer/src/store/github/checks/check-actions.ts
  • src/renderer/src/store/github/github-slice-contract.ts
  • src/renderer/src/store/github/pull-requests/github-pr-request-lifetime.test.ts
  • src/renderer/src/store/github/pull-requests/pull-request-actions.ts
  • src/renderer/src/store/github/pull-requests/pull-request-execution.ts
  • src/renderer/src/store/github/refresh/refresh-event-actions.ts
  • src/renderer/src/store/github/refresh/remote-host-pr-auto-refresh-cadence-sync.test.ts
  • src/renderer/src/store/github/refresh/remote-host-pr-auto-refresh-cadence-sync.ts
  • src/renderer/src/store/github/refresh/remote-host-pr-auto-refresh-cadence.ts
  • src/renderer/src/store/github/requests/request-coordination.ts
  • src/renderer/src/store/slices/hosted-review/refresh/owning-host-cadence-replan.ts
  • src/renderer/src/store/slices/hosted-review/refresh/visible-hosted-review-refresh-scheduler.test.ts
  • src/renderer/src/store/slices/hosted-review/refresh/visible-hosted-review-refresh-scheduler.ts
  • src/renderer/src/store/slices/hosted-review/refresh/visible-hosted-review-refresh-targets.ts
  • src/renderer/src/store/store-observer-installers.ts
  • src/renderer/src/web/preload-api/web-runtime-calls-connection-pin.test.ts
  • src/renderer/src/web/preload-api/web-runtime-calls.ts
  • src/renderer/src/web/preload-api/web-runtime-environments-api.ts
  • src/renderer/src/web/preload-api/web-runtime-pr-subscription-queue.test.ts
  • src/renderer/src/web/preload-api/web-runtime-subscription.ts
  • src/shared/default-global-settings.ts
  • src/shared/github/checks/checks-detail-polling-policy-cadence.test.ts
  • src/shared/github/checks/checks-detail-polling-policy.ts
  • src/shared/github/pull-requests/refresh/pr-quiet-refresh.ts
  • src/shared/github/pull-requests/refresh/pull-request-refresh-types.ts
  • src/shared/review-refresh-policy.test.ts
  • src/shared/review-refresh-policy.ts
  • src/shared/rpc-contract/client-ui/client-settings-params.ts
  • src/shared/rpc-contract/github/github-pull-request-params.ts
  • src/shared/runtime-rpc-call-queue.test.ts
  • src/shared/runtime-rpc-call-queue.ts
  • src/shared/runtime-rpc-subscription-queue.test.ts
  • src/shared/runtime-rpc-subscription-queue.ts
  • tests/e2e/github-pr-hosted-receipt-loop.unit.test.ts
  • tests/e2e/pr-auto-refresh-setting-order.unit.test.ts
  • tests/e2e/pr-refresh-actual-completion.unit.test.ts
  • tests/e2e/runtime-hosted-pr-snapshots-perf.unit.test.ts
Files skipped from review as they are similar to previous changes: 2

  • src/renderer/src/i18n/locales/en.json
  • src/shared/default-global-settings.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b7bef4b9-d480-4eac-a157-bb76802d6570
Commits

Reviewing files that changed from the base of the PR and between 7e44a7f and f1a4718.

Files selected for processing: 27

  • src/main/github/client/lookup/pr-branch-read-resources.ts
  • src/main/github/client/lookup/pr-for-branch-outcome.ts
  • src/main/github/client/lookup/pr-last-outcome.ts
  • src/main/github/client/lookup/pr-read-identity.ts
  • src/main/github/pull-requests/refresh/hosted-pr-read-jobs.ts
  • src/main/github/pull-requests/refresh/pr-refresh-candidate-policy.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-active-visible-priority.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-alias-coalescing.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-restoration.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-test-mocks.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator.ts
  • src/main/github/pull-requests/refresh/pr-refresh-immediate-read.ts
  • src/main/github/pull-requests/refresh/pr-refresh-queue-drainer.ts
  • src/main/github/pull-requests/refresh/pr-refresh-queue-scheduler.ts
  • src/main/github/pull-requests/refresh/pr-refresh-queue.ts
  • src/main/github/pull-requests/refresh/pr-refresh-quiet-policy.perf.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-retry-state.ts
  • src/main/github/pull-requests/refresh/pr-refresh-watch-jobs.ts
  • src/main/runtime/rpc/methods/source-control/github/github-pull-request-methods.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/store/github/github-slice-contract.ts
  • src/renderer/src/store/github/pull-requests/pull-request-execution.ts
  • src/renderer/src/store/github/refresh/refresh-event-actions.ts
  • src/renderer/src/store/slices/hosted-review/refresh/visible-hosted-review-refresh-scheduler.test.ts
  • src/renderer/src/store/slices/hosted-review/refresh/visible-hosted-review-refresh-scheduler.ts
  • src/renderer/src/store/slices/hosted-review/refresh/visible-hosted-review-refresh-targets.ts
  • src/shared/rpc-contract/github/github-pull-request-params.ts
Files skipped from review as they are similar to previous changes: 4

  • src/main/github/client/lookup/pr-last-outcome.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/store/github/pull-requests/pull-request-execution.ts
  • src/renderer/src/store/github/refresh/refresh-event-actions.ts
Files not reviewed due to moderation or processing errors: 8

  • src/main/github/client/lookup/pr-branch-read-resources.ts
  • src/main/github/client/lookup/pr-for-branch-outcome.ts
  • src/main/github/client/lookup/pr-read-identity.ts
  • src/main/github/pull-requests/refresh/hosted-pr-read-jobs.ts
  • src/main/github/pull-requests/refresh/pr-refresh-candidate-policy.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-active-visible-priority.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-alias-coalescing.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-restoration.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Nitpick comments: 1

tests/e2e/pr-refresh-actual-completion.unit.test.ts: 1

273-273: Trivial · Maintainability & Code Quality · Quick win

Remove the internal work-count test.

Lines 273 and 279 require exactly two calls to mocks.resolve. This couples the test to internal read coordination, even when another implementation delivers the correct PR outcome.

Delete this work-count test rather than extending it. Retain outcome coverage at the layer that owns delivery.

Based on learnings, the repository rule states: “Never test … work counts. If you touch a test like that, delete it instead of updating it.”

Source: Learnings

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4309bb2a-f7dc-4390-a4d6-59caa5b27e26
Commits

Reviewing files that changed from the base of the PR and between 7e44a7f and 61bee66.

Files selected for processing: 33

  • src/main/github/client/lookup/pr-branch-read-resources.ts
  • src/main/github/client/lookup/pr-for-branch-outcome.ts
  • src/main/github/client/lookup/pr-last-outcome.ts
  • src/main/github/client/lookup/pr-read-identity.ts
  • src/main/github/pull-requests/refresh/hosted-pr-read-jobs.ts
  • src/main/github/pull-requests/refresh/pr-refresh-candidate-policy.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-active-visible-priority.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-alias-coalescing.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-local-delivery.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-restoration.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-test-mocks.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator.ts
  • src/main/github/pull-requests/refresh/pr-refresh-immediate-read.ts
  • src/main/github/pull-requests/refresh/pr-refresh-queue-drainer.ts
  • src/main/github/pull-requests/refresh/pr-refresh-queue-scheduler.ts
  • src/main/github/pull-requests/refresh/pr-refresh-queue.ts
  • src/main/github/pull-requests/refresh/pr-refresh-quiet-policy.perf.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-read-admission.ts
  • src/main/github/pull-requests/refresh/pr-refresh-retry-state.ts
  • src/main/github/pull-requests/refresh/pr-refresh-visibility.ts
  • src/main/github/pull-requests/refresh/pr-refresh-watch-jobs.ts
  • src/main/runtime/rpc/methods/source-control/github/github-pull-request-methods.ts
  • src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-detail-timer-cadence.test.tsx
  • src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-return-cache.test.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/store/github/github-slice-contract.ts
  • src/renderer/src/store/github/pull-requests/pull-request-execution.ts
  • src/renderer/src/store/github/refresh/refresh-event-actions.ts
  • src/renderer/src/store/slices/hosted-review/refresh/visible-hosted-review-refresh-scheduler.test.ts
  • src/renderer/src/store/slices/hosted-review/refresh/visible-hosted-review-refresh-scheduler.ts
  • src/renderer/src/store/slices/hosted-review/refresh/visible-hosted-review-refresh-targets.ts
  • src/shared/rpc-contract/github/github-pull-request-params.ts
  • tests/e2e/pr-refresh-actual-completion.unit.test.ts
Files with no reviewable changes: 1

  • src/main/github/pull-requests/refresh/pr-refresh-read-admission.ts
Files not reviewed due to moderation or processing errors: 8

  • src/main/github/pull-requests/refresh/pr-refresh-immediate-read.ts
  • src/main/github/pull-requests/refresh/pr-refresh-queue-drainer.ts
  • src/main/github/pull-requests/refresh/pr-refresh-queue-scheduler.ts
  • src/main/github/pull-requests/refresh/pr-refresh-queue.ts
  • src/main/github/pull-requests/refresh/pr-refresh-quiet-policy.perf.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-retry-state.ts
  • src/main/github/pull-requests/refresh/pr-refresh-visibility.ts
  • src/main/github/pull-requests/refresh/pr-refresh-watch-jobs.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6cc17a56-1395-4dba-a5ae-278eea3f1f86
Commits

Reviewing files that changed from the base of the PR and between 7e44a7f and 7cad920.

Files selected for processing: 33

  • src/main/github/client/lookup/pr-branch-read-resources.ts
  • src/main/github/client/lookup/pr-for-branch-outcome.ts
  • src/main/github/client/lookup/pr-last-outcome.ts
  • src/main/github/client/lookup/pr-read-identity.ts
  • src/main/github/pull-requests/refresh/hosted-pr-read-jobs.ts
  • src/main/github/pull-requests/refresh/pr-refresh-candidate-policy.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-active-visible-priority.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-alias-coalescing.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-local-delivery.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-restoration.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator-test-mocks.ts
  • src/main/github/pull-requests/refresh/pr-refresh-coordinator.ts
  • src/main/github/pull-requests/refresh/pr-refresh-immediate-read.ts
  • src/main/github/pull-requests/refresh/pr-refresh-queue-drainer.ts
  • src/main/github/pull-requests/refresh/pr-refresh-queue-scheduler.ts
  • src/main/github/pull-requests/refresh/pr-refresh-queue.ts
  • src/main/github/pull-requests/refresh/pr-refresh-quiet-policy.perf.test.ts
  • src/main/github/pull-requests/refresh/pr-refresh-read-admission.ts
  • src/main/github/pull-requests/refresh/pr-refresh-retry-state.ts
  • src/main/github/pull-requests/refresh/pr-refresh-visibility.ts
  • src/main/github/pull-requests/refresh/pr-refresh-watch-jobs.ts
  • src/main/runtime/rpc/methods/source-control/github/github-pull-request-methods.ts
  • src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-detail-timer-cadence.test.tsx
  • src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-return-cache.test.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/store/github/github-slice-contract.ts
  • src/renderer/src/store/github/pull-requests/pull-request-execution.ts
  • src/renderer/src/store/github/refresh/refresh-event-actions.ts
  • src/renderer/src/store/slices/hosted-review/refresh/visible-hosted-review-refresh-scheduler.test.ts
  • src/renderer/src/store/slices/hosted-review/refresh/visible-hosted-review-refresh-scheduler.ts
  • src/renderer/src/store/slices/hosted-review/refresh/visible-hosted-review-refresh-targets.ts
  • src/shared/rpc-contract/github/github-pull-request-params.ts
  • tests/e2e/pr-refresh-actual-completion.unit.test.ts
Files with no reviewable changes: 1

  • src/main/github/pull-requests/refresh/pr-refresh-read-admission.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

brennanb2025 and others added 13 commits November 13, 2026 18:00
Preserve cadence state across the mobile module moves and asynchronous watch storage. Keep legacy Minimal preferences intact while offering Automatic, Less often and Manual.

Co-authored-by: Jinjing <[email protected]>
Keep live scope fences on prepared reads and compare captured request inputs for demand. Tighten the existing fleet contract, keep narrow settings panels readable, and follow the moved mobile polling owner.

Co-authored-by: Jinjing <[email protected]>
Treat explicit and implicit bindings alike for a known project, and retire that equivalence when project ownership changes. Preserve unknown-account separation without restoring inventory scans. Use the existing muted icon button variant for PR Updates.

Co-authored-by: Jinjing <[email protected]>
Keep the late-response ordering regression focused on host state and option selection, without assertions on UI copy.

Co-authored-by: Jinjing <[email protected]>
@brennanb2025

Copy link
Copy Markdown
Contributor

PR Updates now matches the approved Proposed / Pick UI: Automatic · Less often · Manual, the exact selected helper sentence, and one info tooltip. Older servers are disabled with their host name in the update tooltip; loading is disabled with no helper text. Legacy Minimal remains saved at its original cadence and displays as Less often.

Merged main and preserved both sides’ mobile moves, async CI-watch storage and stop guards, cadence retiming, and queue behavior. Review found and repaired extra worktree inventory scans and an explicit/implicit account mismatch that could skip failure backoff. Known bound/unbound projects now share the correct demand, while unknown or removed ownership remains fenced. The perf contract checks 750 and 7,500 worktrees with one and four windows; demand matching adds zero inventory scans.

Fresh Claude and Codex final repair reviews are clean at a7dcc72d411. The initial full review and both repair passes included the perf screen; the common pattern was compared first-hand.

Validation: typechecks, static ratchets, formatting, changed-code quality and localization coverage passed. The targeted run passed 81 tests across six files; the final owning-layer account/perf controls passed 11/11. Another 14 mobile tests passed. All 18 light/dark settings fixtures were captured, with narrow layout and tooltips checked. The local gate passed 39/40 checks on the production head (broad unit selection hit its cap). After the test-only follow-up it passed 38/40; broad tests and localization extraction hit five-minute caps under shared-machine load. Extraction had passed on the unchanged production diff in the prior run. The mobile polling renderer suite could not load locally because its dependencies are absent; Mobile verify subsequently ran it successfully (19 selected tests and 995 mobile tests passed). A test-only follow-up corrected the existing late-response integration harness to supply TooltipProvider and select options without copy assertions; that suite and settings integration passed all six tests locally.

Final-head CI is green: desktop checks, all 12 unit shards, packaging and selected E2E, Mobile verify, Windows typecheck parity, headless server, and WSL lifecycle/idle cleanup on Fedora, Debian and Ubuntu.

Nonblocking items left unchanged: existing error-toast wording and a test-only watch export. The first CI attempt also hit the untouched journal cleanup test’s wall-clock budget; that shard passed on the final-head run. No open P0/P1 or perf findings remain. Contributor history and co-author credit are preserved.

Automatic

Less often (dark)

Manual

Info tooltip

Older server

Loading

Narrow panel

@brennanb2025
brennanb2025 merged commit da8d128 into main Nov 14, 2026
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants