Repository navigation
fix(worktree): reconcile symlinked creates by Git identity - #10266
Conversation
On immutable Linux, /home is often a symlink to /var/home. git worktree list reports the realpath while Orca still holds the /home request path, so creation failed with "Worktree created but not found in listing". After local worktree add, fall back to realpath when string comparison misses. Keep WSL listings on string comparison only (host realpath is not authoritative there). Closes #10170
|
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 (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 4e734012-ca2d-4627-9bec-4fa8274440df
📒 Files selected for processing (6)
src/main/ipc/created-worktree-reconciliation.test.tssrc/main/ipc/created-worktree-reconciliation.tssrc/main/ipc/worktree-logic.tssrc/main/ipc/worktree-remote.tssrc/main/ipc/worktree-symlink-reconciliation.real.test.tssrc/main/runtime/orca-runtime.ts
| type WorktreeBasePathRepo = Pick<Repo, 'path' | 'worktreeBasePath'> | ||
|
|
||
| export { computeBranchName, getConfiguredBranchPrefix } from './worktree-branch-name' | ||
| export { findCreatedWorktree } from './created-worktree-reconciliation' |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
Register the new module in the TypeScript project.
verify fails because config/tsconfig.tc.web.json does not include src/main/ipc/created-worktree-reconciliation.ts. Add the file to its files list or broaden its include pattern so TypeScript checking passes.
🧰 Tools
🪛 GitHub Actions: PR Checks / verify
[error] 12-12: TypeScript (tsc) failed with TS6307: File '/home/runner/work/orca/orca/src/main/ipc/created-worktree-reconciliation.ts' is not listed within the file list of project 'config/tsconfig.tc.web.json'. Projects must list all files or use an 'include' pattern.
🪛 GitHub Check: verify
[failure] 12-12:
File '/home/runner/work/orca/orca/src/main/ipc/created-worktree-reconciliation.ts' is not listed within the file list of project '/home/runner/work/orca/orca/config/tsconfig.tc.web.json'. Projects must list all files or use an 'include' pattern.
Source: Linters/SAST tools
…10266) * fix(worktree): match created worktrees through symlink roots On immutable Linux, /home is often a symlink to /var/home. git worktree list reports the realpath while Orca still holds the /home request path, so creation failed with "Worktree created but not found in listing". After local worktree add, fall back to realpath when string comparison misses. Keep WSL listings on string comparison only (host realpath is not authoritative there). Closes stablyai#10170 * test(worktree): harden symlink reconciliation authority * fix(worktree): reconcile creation by Git branch identity * test(worktree): reproduce symlink-root listing with real Git * test(worktree): cover cross-platform reconciliation * fix(worktree): keep reconciliation main-only --------- Co-authored-by: Wooseong Kim <[email protected]> Co-authored-by: OrcaWin <[email protected]>
Summary
refs/heads/<created branch>row returned by the same Git hostrealpathauthority and filesystem probes for native, WSL, and future remote reuseFixes #10170. Supersedes the filesystem-realpath approach proposed in #10172; credit to @innocarpe for the original diagnosis and candidate.
Test plan
git -c maintenance.auto=false worktree addthrough a symlink root, followed bygit worktree list --porcelaincanonical-path reconciliationpnpm exec vitest run --config config/vitest.config.ts src/main/ipc/created-worktree-reconciliation.test.ts src/main/ipc/worktree-symlink-reconciliation.real.test.ts src/main/ipc/worktrees.test.ts src/main/ipc/worktrees-windows.test.ts(213 passed)pnpm exec tsc --noEmit -p config/tsconfig.node.json --pretty falsegit diff --check origin/main...HEADScreenshots
Not applicable; no UI change.
Security audit
The fallback trusts exact branch identity from the authoritative Git listing and performs no filesystem resolution. WSL and SSH paths are never interpreted by the desktop filesystem.
AI review report
Independent adversarial, performance/security, and Git-compatibility reviews found no blocking issue in the final replacement.
Notes
No production Git command changed; Git 2.25 compatibility and leading global
-cfetch options are preserved.