[FIX] mirror workspace dirs into account + migrate stale statusline install#21
Merged
Merged
Conversation
linkAccountDirsToWorkspace only moved account dirs INTO the workspace. A dir another account created in the shared workspace (or one added directly) never got a symlink back in this account, so it was invisible here. Add a second pass: for every non-private directory in the pinned workspace that the account lacks, create a symlink account/<name> -> workspace/<name>. Gap-fill only: names the account already has (a dir merged+symlinked by pass 1, a plain file, or an existing symlink) are left untouched. Skips the private set (backups/cache/cc-statusline), dotfiles, and workspace files (only dirs). Runs on every claude launch via _prepare-claude-launch, so shared dirs converge across all accounts pinned to the same workspace. Idempotent.
…file Installing a package whose file targets <WORKSPACE_CLAUDE_DIR>/… (e.g. the statusline program) left an older pre-workspace copy behind at the account path when it had no lock recording it. The account's settings.json gets re-pointed to the workspace path (patchSettings overwrites the command), but the dead account copy of statusline.js lingered and confused the setup. CopyFileExecutor.apply now, on a workspace-marker copy, removes any stale account-relative file (or symlink) of the same basename. Never removes a real directory. This migrates pre-v3.1.4 per-account statusline installs cleanly.
…t pin Refines the earlier two-way mirror per design decision: the account→workspace move/merge is a one-time SEED that belongs at pin, not something to re-run on every launch. Split the direction: - Extract mirrorWorkspaceDirsToAccount (workspace→account): symlink every non-private workspace dir the account is missing; never moves or merges account data. linkAccountDirsToWorkspace (pin, via prepareDirectory) still does the account→workspace migration and then delegates to the mirror. - _prepare-claude-launch now calls mirrorWorkspaceDirsToAccount only, so launch never migrates. A real dir claude created in the account stays put until the next `orrery pin` seeds it into the workspace. Reworks the launch tests to the new contract (mirror in, no migration) and adds a direct mirror-only test proving an account real dir is left untouched.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two related account/workspace-linking fixes.
1. Mirror all non-private workspace dirs into the account at launch
linkAccountDirsToWorkspaceonly moved account dirs into the workspace. If another account created a dir in the shared workspace (or one was added directly), this account never got a symlink back to it — so it was invisible here.Added a second pass (workspace→account): for every non-private directory in the pinned workspace the account lacks, create
account/<name> -> workspace/<name>. Gap-fill only (leaves existing dirs/files/symlinks untouched), skips the private set (backups/cache/cc-statusline), dotfiles, and workspace files (dirs only). Runs on every launch via_prepare-claude-launch, so shared dirs converge across all accounts on a workspace. Idempotent.2. Workspace-marker install removes the stale account copy
Installing a package whose file targets
<WORKSPACE_CLAUDE_DIR>/…(the shared statusline program) left an older pre-workspace copy at the account path when no lock recorded it.settings.jsongot re-pointed to the workspace path (patchSettings overwrites the command), but the dead<account>/statusline.jslingered.CopyFileExecutor.applynow removes any stale account-relative file/symlink of the same basename on a workspace-marker copy. Never removes a real directory. Migrates pre-v3.1.4 per-account statusline installs cleanly.Test Plan
🤖 Generated with Claude Code