Repository navigation
perf: overlap independent worktree create preflight - #17386
Conversation
|
Validation update:
The optimization intentionally leaves the runtime PR/branch review probe behavior unchanged; only existing read-only probes are overlapped, and all mutations retain their prior order. |
|
Follow-up commit Additional focused run: 40 tests passed across local create and SSH/WSL base-ref/suffixing suites; direct typecheck, oxlint, oxfmt, and diff checks pass. |
|
Readiness check (2026-08-30):
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughIndependent read-only probes in remote and local worktree creation now start concurrently through Merge Risk: ⚪ Minimal · up to This PR overlaps independent preflight work while preserving existing mutation ordering and behavior; no actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the implementation, scope, risks, and evidence clearly, but it omits most required template sections. It does not provide the required linked issue, completed testing checklist, visual-proof statement, AI disclosure, review notes, agent-skill boundary checkbox, notes, or final checklist. Resolution Complete the repository template. Add the required Linked Issue entry, state N/A with a reason for Visual Proof, document testing platforms and mark the applicable Testing checkboxes, complete AI Disclosure if applicable, add Review and Notes content, mark the Agent skill upstream boundary option, and complete the Checklist items. Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (1 skipped: 1 too large.)
✨ Finishing Touches 💡 1📝 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 |
Greptile SummaryThe PR reduces worktree-creation latency by overlapping independent, read-only preflight and post-creation discovery operations while preserving mutation order.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| src/main/ipc/worktree-remote.ts | Overlaps independent local and SSH preflight probes and post-creation path discovery while retaining fallback and mutation sequencing. |
| src/main/runtime/orca-runtime.ts | Applies the same concurrent preflight and path-discovery organization to runtime-owned worktree creation. |
| src/main/ipc/worktrees-local-create-flow.test.ts | Adds deterministic coverage showing username and default-base probes start concurrently. |
Sequence Diagram
sequenceDiagram
participant C as Worktree create flow
participant U as Username probe
participant B as Base-plan probe
participant G as Git worktree creation
participant S as Shared-directory discovery
participant I as Worktree-include discovery
C->>U: Start
C->>B: Start
par Independent preflight
U-->>C: Username
and
B-->>C: Base plan
end
C->>G: Create worktree
G-->>C: Created checkout
par Independent discovery
C->>S: Resolve shared paths
S-->>C: Shared directories
and
C->>I: Resolve include paths
I-->>C: Include entries
end
C->>C: Create shared paths
C->>C: Copy remaining include entries
Reviews (2): Last reviewed commit: "test: prove preflight probes start concu..." | Re-trigger Greptile
There was a problem hiding this comment.
ℹ️ No critical issues — the overlap itself is sound, but the new test doesn't actually verify concurrency (see inline).
Reviewed changes
- Overlapped SSH preflight —
createRemoteWorktreenow resolves the branch-prefix username and the base plan, and later the remote-tracking/local-base presence probes, concurrently viaPromise.all. - Overlapped local preflight —
createLocalWorktreeoverlaps username + base resolution, the remote-tracking/local-base presence checks, and shared-directory +.worktreeincludediscovery. - Overlapped runtime-service preflight —
OrcaRuntimeService.createWorktreeapplies the same overlaps. - New concurrency test — a deterministic test in
worktrees-local-create-flow.test.tsintended to prove the username and base probes start before either completes.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Concurrency test now actually verifies overlap — the
username-start/base-startevents are recorded inside the mocks'mockImplementationcallbacks instead of the promise executors, so a sequential implementation would leaveeventsas['username-start']and fail the assertion at line 152.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Readiness checklist passed; required CI and review checks are green.

Summary
orca.yamlshared directories and.worktreeincludeentries concurrently after the worktree exists; shared-path mutations still finish before include copies.This is a small, read-only preflight optimization extracted from the broader early-terminal work in #13704. It does not change IPC/RPC payloads, checkout semantics, cleanup, or terminal startup.
Correctness / risk
Evidence
[email protected]lockfile entry.Follow-up context