Repository navigation
Reduce duplicate worktree refresh scans - #6390
Merged
Merged
Conversation
Contributor
📝 WalkthroughWalkthroughThe worktree store adds a keyed in-flight promise map and a coalesced helper for detected worktree refreshes. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
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 |
6 of 8 tasks
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
* Reduce duplicate worktree refresh scans * Preserve host identity during overlapping worktree refreshes --------- Co-authored-by: Neil <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reduces duplicate worktree refresh scans by coalescing concurrent detected-worktree refreshes for the same repo, execution host, runtime target, and refresh mode. Each caller still performs its own state merge after the shared scan resolves, so existing visible/detected worktree semantics remain local to the caller.
A follow-up verification pass found and fixed an SSH overlap edge:
fetchDetectedWorktreesnow uses the same host-scoped merge/stamp path as visible refreshes so a detected-only refresh cannot clobber SSH/runtime host identity when it overlapsfetchWorktrees.Design and Review
fetchDetectedWorktrees,fetchWorktrees, and bothfetchAllWorktreespaths through the coalesced scanner. Added focused regression coverage for same-host coalescing, detected/visible overlap, authoritative separation, same-repo/different-host separation, and SSH host identity preservation in both detected/visible overlap orders.Screenshots
Not applicable; this is renderer store/runtime refresh behavior and does not change visible UI or layout.
Security Audit
finally, so failed refreshes are not cached or reused after settlement.Tests
pnpm vitest run --config config/vitest.config.ts src/renderer/src/store/slices/worktrees.test.ts(160 tests)pnpm run typecheckpnpm run lint(passes; emits an existing warning insrc/renderer/src/components/right-sidebar/useGitStatusPolling.ts)git diff --checktrack-community-prandverifypassed.Notes
pnpm install --frozen-lockfile; optionalcpu-featuresnative build could not find a Visual Studio toolchain, but repo postinstall skipped/recovered optional native modules and install exited successfully.