Repository navigation
Avoid refreshing every repository after deleting one worktree - #26253
Conversation
|
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; 0 remain after this review. 📝 WalkthroughWalkthroughWorktree removal now invalidates authorized-root cache entries for the given store and repository. Tests for forced and normal missing-worktree cleanup and archive-hook removal check the scoped arguments. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to Removal now avoids refreshing unrelated repositories while retaining broader invalidation when ownership is unclear. The inspected paths show no actionable merge risk. 🚥 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 |
ELI5
Deleting one worktree should make Orca refresh that repository’s authorized paths, rather than launch Git for every repository before the next file operation.
What Changed
The completed-removal cleanup now calls the existing repository-scoped authorization invalidator with its store and repository ID. It retires the changed owner’s paths and revision. The helper retains its global fallback when that ID has no unique local owner, including remote-only and duplicate-host entries.
Why
The deletion already knows which repository changed; its owner catalog does not change here. Reusing the helper already used by worktree creation avoids a new cache or authorization policy. Catalog/routing changes and orphan/folder removal keep their existing paths.
Seven alternating paired macOS trials exercised actual public removal, completed native Git deletion, and the next authorization for a surviving checkout:
At 24 repositories, authorization alone took 31.17 → 4.58 ms. Separately counted native authorization listings fell from 24 to one (eight to one in the eight-repository case). No claim about every action becoming faster or the intermittent Codex typing pause.
Linked Issue
No linked issue; maintainer performance audit.
Visual Proof
N/A — this changes authorization-cache refresh work after deletion; removal results, notifications and rendered interaction are unchanged.
Testing
Three existing public-removal regressions fail on baseline because invalidation receives no owner, then pass with this change: registered removal and forced/normal cleanup of an already-missing worktree. All seven selected suites pass: 1,384 tests, one existing skip; they include the complete runtime characterization, scoped invalidation, root ownership/refresh/WSL routing, and failed/interrupted removal recovery. Node typecheck, changed-code quality and formatting pass. The three regressions also pass on the Node runner; a fresh Electron build passes.
Temporary qualification used real owned Git repositories, actual cache/authorization code and public deletion, with an empty terminal/watcher/browser fixture and a constructor boundary for unrelated runtime owners. Thirteen control records cover unique/unknown/ambiguous/local/remote/folder owners and public folder/SSH-provider-fixture removal. Two additional controls hold real Git replies across public deletion: late affected-owner replies cannot restore the removed root, public file authorization still rejects it, and surviving files remain authorized. Complete results, metadata and callback/provider routing match. Untouched owner revisions remain valid under the existing scoped policy. All owned fixture directories were removed.
Native Linux/Windows/WSL and physical SSH transport were not exercised; remote routing controls use explicit providers. No Git command, remote wire, process-status or execution-host ownership change.
Review
Independent source review read the full removal callers, ownership resolver and existing cache/invalidation policy. A second review checked the final production and regression diff. No ordinary behavior tradeoff identified.
Agent skill upstream boundary
Notes
Two production lines changed; no new cache, timer, IPC field or polling. Combined with all 35 audit changes: the seven affected suites / 1,384 tests pass (one existing skip), full
pnpm tcpasses, and the 109-file changed-code quality gate reports no new findings. All required selected hosted checks pass (15 successful checks; 15 unselected checks skipped).Checklist