Skip to content

feat(worktrees): configure sharedDirectories fallbacks - #31

Merged
nplez1 merged 2 commits into
nplez1/mainfrom
nplez1/shared-directory-copy-strategy
Sep 25, 2026
Merged

nplez1 merged 2 commits into
nplez1/mainfrom
nplez1/shared-directory-copy-strategy

Conversation

@nplez1

@nplez1 nplez1 commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner
Files Added Deleted Net
Test 14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​757 $\color{#cf222e}{\Huge{\mathbf{−}}}$​100 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​657
Prod 25 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​792 $\color{#cf222e}{\Huge{\mathbf{−}}}$​363 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​429

ELI5

New worktrees usually link configured shared folders back to the primary checkout. This change lets each project choose what Orca should do when creating those folders, including avoiding symlinks.

What Changed

  • Added a Repository setting for worktree.sharedDirectories: keep symlinks, try an APFS clone and fall back to symlinks or copies, or skip if cloning is unavailable.
  • Kept the existing symlink behavior as the default for existing projects.
  • Staged clones and copies before publishing them; checked directory targets and used exclusive file publication to avoid overwriting destinations. Paths that could not be materialized are surfaced in the create warning.
  • Kept .worktreeinclude copies under their existing budget. The explicitly selected shared-directory copy fallback has no size or entry-count cap.

Why

Some projects cannot use symlinks, and APFS cloning is not always available. An explicit per-project choice avoids silently changing the sharing behavior. Copies and APFS clones are independent per worktree; symlinks continue to share writes with the primary checkout.

Linked Issue

Related to stablyai/orca#18213. This PR adds materialization choices and reports failures; it does not add workspace-monorepo symlink detection.

Visual Proof

Default behavior — symlink selected:

Repository setting with the default symlink behavior

After — APFS clone with copy fallback selected:

Repository setting with APFS clone and copy fallback selected

Testing

  • Manually checked the Repository setting in the hidden Electron renderer through CDP on macOS.
  • Added/updated automated tests for settings persistence and validation, clone/copy/symlink/skip behavior, partial-clone cleanup, copy-budget isolation, destination races, and staging cleanup.
  • Focused changed-test run after the module split: 191 tests across all 13 changed test files passed.
  • pnpm tc passed.
  • pnpm run check:code-quality:changed passed.
  • git diff --check passed.
  • Windows was not available for runtime testing. SSH worktrees intentionally do not materialize these paths yet.

AI Disclosure

AI-assisted with GitHub Copilot GPT-6 Luna and Mimo v2.6 Pro adversarial review.

Review

Mimo's review found no blockers. The documented residuals are the narrow POSIX empty-directory publish race, crash-leftover staging paths when configuration has changed or ownership cannot be verified, and untested Windows runtime behavior.

Agent skill upstream boundary

  • Not applicable. This change does not copy or modify agent-skill installer source.

Notes

  • The explicit copy fallback can take a long time and use substantial disk space because it is not size- or entry-count-limited.
  • SSH worktrees skip shared path materialization.

Checklist

  • Automated tests added/updated.
  • Cross-platform, SSH/remote, and backward-compatibility impact considered; Windows runtime verification remains for CI/a Windows host.
  • Full pnpm lint and pnpm build were not run locally; CI will cover them.

@nplez1
nplez1 merged commit 244781d into nplez1/main Sep 25, 2026
60 of 62 checks passed
nplez1 added a commit that referenced this pull request Sep 25, 2026
* feat(worktrees): configure sharedDirectories fallbacks

* fix(i18n): sync shared directory setting strings
nplez1 added a commit that referenced this pull request Sep 27, 2026
* feat(worktrees): configure sharedDirectories fallbacks

* fix(i18n): sync shared directory setting strings
nplez1 added a commit that referenced this pull request Sep 29, 2026
* feat(worktrees): configure sharedDirectories fallbacks

* fix(i18n): sync shared directory setting strings
nplez1 added a commit that referenced this pull request Oct 1, 2026
* feat(worktrees): configure sharedDirectories fallbacks

* fix(i18n): sync shared directory setting strings
nplez1 added a commit that referenced this pull request Oct 6, 2026
* feat(worktrees): configure sharedDirectories fallbacks

* fix(i18n): sync shared directory setting strings
nplez1 pushed a commit that referenced this pull request Oct 19, 2026
…f the deprecated owner resolver; spawn refuses folder twins (stablyai#30497)

* refactor(renderer): fold launch, resume, note-send, paste and terminal-create callers off the deprecated owner resolver

Agent launch, AI-vault resume and reveal, note target and send, wake and creation seeds, native chat
owner, the shell menu and active-workspace terminal creation (#22, #31-#42, #44) read the owner
through runtimeEnvironmentIdWithLegacyFallbackUnlessTwin. Paste uploads images to the server its
PTY id names before falling back to the workspace owner. The folder and floating branch of the
terminal spawn route (#53) reads resolveOwnerWithLegacyFallback: spawn refuses a folder twin
instead of following the focused server, and teardown keeps tearing raw ids down locally.
Deprecated importers 31 -> 16.

* test: give the paste-listener and tab-bar probes the fields the folded callers read

* test: note why the folder-twin route fixture is cast

* test: type the paste-owner twin fixture
@nplez1
nplez1 deleted the nplez1/shared-directory-copy-strategy branch October 24, 2026 03:23
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