Repository navigation
fix(claude): share account history on Windows with junctions and a same-drive hardlink - #26067
Conversation
…me-volume hardlink (STA-3698) Windows skipped history sharing for Orca-managed Claude account folders on the mistaken premise that it needs symlink privilege. Session folders now use directory junctions and history.jsonl a same-volume hardlink, neither of which needs elevation. A different volume or a failed link keeps that account's prompt history private and reports it. A small link record tells a replaced shared file apart from the account's own copy so prompts the user removed are never merged back. Renames retry on Windows file locks.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughWindows profile sharing now processes history directories and Priority: ⬇️ Low Merge Risk: 🔵 Low · up to The affected Windows sharing helper currently has no identified production caller, limiting immediate exposure. If activated with a missing link record and a replaced shared file, previously removed prompts can reappear; address this before wiring up the feature. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
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: 2
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
de367808-e6ba-4acf-af4b-557bb1e45f5b
📒 Files selected for processing (4)
src/main/claude-accounts/claude-profile-history-windows.test.tssrc/main/claude-accounts/claude-profile-history.test.tssrc/main/claude-accounts/claude-profile-history.tssrc/main/claude-accounts/claude-profile-prompt-history.ts
💤 Files with no reviewable changes (1)
- src/main/claude-accounts/claude-profile-history.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
…ning set-aside prompt history A pending set-aside copy was appended to the shared history.jsonl before the same-volume check refused the share, leaking the account's prompts into it. Co-Authored-By: Claude <[email protected]>
Windows now shares account history with System default (#26067), so the Windows-only 'chat history is deleted' wording no longer holds.
ELI5
When Orca keeps a separate Claude folder per account, it links that folder's chat history to your normal Claude folder so every account sees the same past sessions and prompts. On Windows we skipped that linking, so each account would have kept its own separate history. This PR turns the linking on for Windows too, using Windows link types that do not need admin rights.
What Changed
projects,todos, ...) and its prompt history (history.jsonl) private to that account.history.jsonlbecomes a hardlink to the shared file, exactly like the symlinks macOS and Linux already get. Anything the account already had is merged in first, the same way as on macOS/Linux.Users see no change yet: account-folder setup is not called from any live path on
mainuntil routing is switched on.Why
The Windows skip was copied from another project whose reason ("symlinks need elevation on Windows") does not apply here: junctions and same-drive hardlinks need no elevation. This brings back the original design from the account-folder work, on top of today's merge rules (append only lines not already present, delete fully drained set-aside copies). Copying history instead of linking was rejected because copies diverge.
Linked Issue
STA-3698
Visual Proof
N/A: no UI change; account-folder setup is not yet reachable from the app.
Testing
New
src/main/claude-accounts/claude-profile-history-windows.test.tsruns the Windows path (junction + hardlink, CLI rewrite, replaced shared file, unreadable record, different drive, link failure, record-write failure, interrupted share). Junctions and hardlinks need no privilege, so it runs on real Windows as well as macOS/Linux.pnpm tc:node,pnpm tc:cli, vitest onsrc/main/claude-accounts/andsrc/main/claude/, oxlint, and the changed-code quality gate pass on macOS.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
SSH and WSL: sharing runs on the machine that owns the account folder, unchanged. macOS/Linux behavior is unchanged.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)