Repository navigation
perf(worktrees): preserve Git scans when saving sort order - #27343
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to No actionable issue was established that would prevent merging. The desktop scan-regression test coverage remains uncertain. Pre-merge checks |
|
Credit @mmarabel for identifying the repeated scans and the host-only approach in #27271. Co-authored-by: mmarabel <[email protected]>
762841b to
be2c872
Compare
…p hosts too The desktop window notifier ran the worktree-change invalidators unconditionally, so a desktop (or paired-host) Orca still cleared Git scan caches on every sidebar order save. Carry the invalidateGitScans flag through the notifier; every other caller keeps the default.
ELI5
Saving the sidebar order on a paired remote host should not make Git scan every repository again. Reuse the existing scans while publishing the same order updates to desktop and mobile clients.
What Changed
Order saves already invalidate the combined worktree rows so the next listing reads fresh
sortOrdermetadata. They now explicitly skip invalidating the separate Git scan caches through an optional flag on the existing notifier. The flag is also forwarded through the desktop window notifier, so both headless and desktop hosts preserve those scans. Structural changes still invalidate the caches; the desktop notification and existingworktreesChangedevent remain in place.Why
@mmarabel identified this waste and proposed the host fix in #27271. Their report measured 25 Git worktree scans per save and 40–74 fleet sweeps per hour on a paired host with 25 repositories. This removes the scans caused by order saves while preserving normal cache expiry and structural invalidation.
A focused notifier option avoids another notification method or a renderer scheduler. The regression proves a save publishes the new order with one initial Git scan instead of two, then proves a structural change still triggers a second scan.
Linked Issue
Addresses the unnecessary host scans in #27268. The repeated desktop lineage downloads described there remain outside this change.
Visual Proof
N/A — only background cache invalidation changes; no rendered interface changes.
Testing
macOS arm64, with
ORCA_BACKGROUND_LAUNCH=1:pnpm tcpassed.pnpm run check:code-quality:changedpassed with zero new findings across three files.git diff --checkpassed.GitHub CI passed on the merged head
d3eb9b6052409b71ee4305accc103e1ae3add1b8. Live paired-host acceptance was not performed locally.Review
Independent review checked notifier callers, resolved metadata projection, structural invalidation and cache freshness. The production change affects only the sort-order notification call and an optional flag that defaults to current behavior.
Agent skill upstream boundary
Notes
No new subprocesses, dependencies, RPC fields or stream messages. Scan ownership stays on the execution host. Folder-workspace metadata still gets refreshed, SSH scan policy is unchanged, and older clients receive the same event. Expected merge risk is low; no negative user-facing trade-offs identified.
This change makes no claim to the original PR's reduction from roughly 1.4 MB to 0.3 MB per save: that required separate renderer changes.
Checklist