fix(worktrees): respect Windows shell for setup runners#6967
Conversation
|
Ready to review this PR? Stage has broken it down into 6 individual chapters for you: Chapters generated by Stage for commit 5b717f1 on Jul 1, 2026 1:07am UTC. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (5)
📝 WalkthroughWalkthroughThis PR adds a 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
src/shared/setup-runner-command.ts (1)
59-83: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a short “why” comment for the Windows shell/path translation logic.
This branching is doing non-obvious behavior (
/c/...vs/mnt/c/..., PowerShell vs cmd fallback), so a brief rationale here would make future edits much safer.As per coding guidelines,
**/*.{ts,tsx,js,jsx}: "When writing or modifying code driven by a design doc or non-obvious constraint, add a comment explaining why the code behaves the way it does."Also applies to: 121-144
Source: Coding guidelines
src/renderer/src/lib/launch-worktree-background-terminals.ts (1)
121-126: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDocument why background setup launches must reuse
setup.shell.The extra argument is easy to remove in a later cleanup unless this helper states that deferred/background setup tabs must preserve the shell chosen when the runner was generated.
As per coding guidelines,
**/*.{ts,tsx,js,jsx}: "When writing or modifying code driven by a design doc or non-obvious constraint, add a comment explaining why the code behaves the way it does."Source: Coding guidelines
src/renderer/src/lib/worktree-activation.test.ts (1)
75-121: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd one shell-aware
issueCommandcase.These additions cover setup launches well, but Line 723 in
src/renderer/src/lib/worktree-activation.tsnow forwardsissueCommand.shellthroughbuildSetupRunnerCommand(), and the suite still only exercises the shell-less issue-command path. A single PowerShell or WSL issue-command assertion would keep that new branch from regressing unnoticed.Also applies to: 419-441, 596-624
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: fc5113fa-9220-4c39-9fa8-b692d0d63a89
📒 Files selected for processing (17)
src/main/hooks.test.tssrc/main/hooks.tssrc/main/ipc/worktree-remote.tssrc/main/ipc/worktrees-windows.test.tssrc/main/ipc/worktrees.test.tssrc/main/runtime/orca-runtime.test.tssrc/main/runtime/orca-runtime.tssrc/renderer/src/lib/launch-worktree-background-terminals.test.tssrc/renderer/src/lib/launch-worktree-background-terminals.tssrc/renderer/src/lib/setup-runner.tssrc/renderer/src/lib/worktree-activation.test.tssrc/renderer/src/lib/worktree-activation.tssrc/shared/setup-agent-sequencing.test.tssrc/shared/setup-agent-sequencing.tssrc/shared/setup-runner-command.test.tssrc/shared/setup-runner-command.tssrc/shared/types.ts
|
Addressed the CodeRabbit pass in |
Summary
Closes #6896.
Testing
pnpm lintpnpm typecheckpnpm testpnpm buildFocused validation run in this session:
rtk pnpm.CMD exec vitest run --config config/vitest.config.ts src/main/hooks.test.ts src/shared/setup-runner-command.test.ts src/shared/setup-agent-sequencing.test.ts src/main/ipc/worktrees.test.ts src/main/ipc/worktrees-windows.test.ts src/main/runtime/orca-runtime.test.ts src/renderer/src/lib/worktree-activation.test.ts src/renderer/src/lib/launch-worktree-background-terminals.test.ts- passed (815tests,4skipped).rtk pnpm.CMD run typecheck:node- passed.rtk pnpm.CMD run typecheck:web- passed.rtk pnpm.CMD exec oxlint src/main/hooks.test.ts src/main/hooks.ts src/main/ipc/worktree-remote.ts src/main/ipc/worktrees-windows.test.ts src/main/ipc/worktrees.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/orca-runtime.ts src/renderer/src/lib/launch-worktree-background-terminals.test.ts src/renderer/src/lib/launch-worktree-background-terminals.ts src/renderer/src/lib/setup-runner.ts src/renderer/src/lib/worktree-activation.test.ts src/renderer/src/lib/worktree-activation.ts src/shared/setup-agent-sequencing.test.ts src/shared/setup-agent-sequencing.ts src/shared/setup-runner-command.test.ts src/shared/setup-runner-command.ts src/shared/types.ts- passed.rtk pnpm.CMD exec oxfmt --check src/main/hooks.test.ts src/main/hooks.ts src/main/ipc/worktree-remote.ts src/main/ipc/worktrees-windows.test.ts src/main/ipc/worktrees.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/orca-runtime.ts src/renderer/src/lib/launch-worktree-background-terminals.test.ts src/renderer/src/lib/launch-worktree-background-terminals.ts src/renderer/src/lib/setup-runner.ts src/renderer/src/lib/worktree-activation.test.ts src/renderer/src/lib/worktree-activation.ts src/shared/setup-agent-sequencing.test.ts src/shared/setup-agent-sequencing.ts src/shared/setup-runner-command.test.ts src/shared/setup-runner-command.ts src/shared/types.ts- passed.rtk git diff --check- passed.AI Review Report
Reviewed the final diff for Windows cmd, PowerShell, Git Bash, and WSL setup behavior across local worktree creation, SSH worktree setup, wait-for-setup sequencing, runtime-spawned and renderer-spawned setup terminals, path quoting, and automation background setup launches. The change is scoped to setup runner generation plus setup runner launch command routing.
Security Audit
Setup still runs only through the existing user-approved setup flow. The change adds explicit shell metadata, selects
.cmd,.ps1, or.shrunner content from that metadata, and reuses the existing setup terminal launch path. No new background execution path is added.Notes
Scope is limited to worktree setup runner generation and launch semantics on Windows. Ordinary terminal spawning, archive hooks, notification behavior, and unrelated git provider behavior are unchanged.