Skip to content

fix(filesystem-auth): allow worktree access through macOS /var canonical alias - #1589

Merged
AmethystLiang merged 1 commit into
mainfrom
worktree-access-issue
May 8, 2026
Merged

AmethystLiang merged 1 commit into
mainfrom
worktree-access-issue

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented May 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Worktrees registered with /var/folders/... paths were inaccessible after fix: avoid repeated macOS privacy prompts #1524 stopped realpath'ing roots during background refreshes — file handlers canonicalize to /private/var/folders/... which never matches the textual root cache.
  • Pass the pre-realpath source path through resolveAuthorizedPath and lazily canonicalize the matching registered ancestor only when the user actively touches it. The canonical root gets cached for subsequent lookups, so we still avoid macOS TCC probes on background refreshes.
  • Symlink escapes still fail — the canonical target must descend from the canonical root, not just the textual one.

Test plan

  • pnpm vitest run src/main/ipc/filesystem.test.ts — 35 passed (including 3 new cases: allow readDir alias, allow deletePath alias, reject symlink escape)
  • pnpm typecheck
  • pnpm lint src/main/ipc/filesystem-auth.ts src/main/ipc/filesystem.test.ts

Made with Orca 🐋

…cal alias

#1524 stopped realpath'ing every worktree root during background refreshes
to avoid TCC prompts, which broke File Explorer for worktrees registered
under /var/folders when realpath canonicalizes them to /private/var/folders.

Lazily canonicalize the registered root only when the user actively touches
it: pass the pre-realpath source path through resolveAuthorizedPath so
isPathAllowedIncludingRegisteredWorktrees can match the canonical target
against the source's registered ancestor and cache the canonical root for
future lookups.

Co-authored-by: Orca <[email protected]>
@AmethystLiang
AmethystLiang merged commit e400191 into main May 8, 2026
3 checks passed
@AmethystLiang
AmethystLiang deleted the worktree-access-issue branch May 8, 2026 17:22
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…cal alias (stablyai#1589)

stablyai#1524 stopped realpath'ing every worktree root during background refreshes
to avoid TCC prompts, which broke File Explorer for worktrees registered
under /var/folders when realpath canonicalizes them to /private/var/folders.

Lazily canonicalize the registered root only when the user actively touches
it: pass the pre-realpath source path through resolveAuthorizedPath so
isPathAllowedIncludingRegisteredWorktrees can match the canonical target
against the source's registered ancestor and cache the canonical root for
future lookups.

Co-authored-by: Orca <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant