You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
P2: Include WSL worktree roots in orphan sweep and retention GC #1401
resolveWorktreeDir places WSL project worktrees inside the distro at <repoParent>/.solenta/worktrees/<threadId> (or /tmp/solenta-worktrees for a mounted repo). On origin/maine2924af, both sweepOrphanWorktrees and gcScanInner enumerate only worktreeBase, the Windows app-data directory. The periodic retention sweeper passes only that base. As a result, WSL worktrees never become orphan or retention candidates, so #434's correct placement can accumulate disk indefinitely. The source comment notes the boot orphan limitation; no WSL GC coverage was found.
Change
Enumerate worktree roots derived from configured WSL projects alongside the normal app-data root, using the existing candidate classification, dirty/unmerged guards, grace rules, and branch-preserving removal. Keep scanning bounded to known Solenta worktree roots. Include WSL usage in the GC view and periodic retention.
Check
A WSL-root clean, settled worktree past retention is discovered and reclaimed; a dirty or live WSL worktree is kept; an orphan is classified using the same safety rules. Native Windows and macOS roots retain current behavior.
Isolated path probe: resolveWorktreeDir({path: '\\\\wsl.localhost\\Ubuntu\\home\\user\\repo'}, 'C:\\Users\\user\\AppData\\Solenta\\worktrees', 'thread-1', 'win32') returns the UNC directory \\\\wsl.localhost\\Ubuntu\\home\\user\\.solenta\\worktrees\\thread-1 and Linux add path /home/user/.solenta/worktrees/thread-1. The returned directory is outside the base passed to both GC scanners. This probe checks path routing only; it is not a Windows end-to-end GC run.
The change itself is already on main. It landed in 70b5595 (#1544, part of #1531). worktreeRoots in electron/worktrees-gc.js now adds the WSL roots resolveWorktreeDir uses, including /tmp/solenta-worktrees for mounted repos, as non-app-owned roots. Three things use it: the boot orphan sweep, gcScan (the GC view's usage) and enforceRetention (the periodic sweeper). In a non-owned root, GC only considers dirs named like a thread id that are registered linked worktrees of a known project, and it never force-removes a dir git can't read.
Traced on win32:
registeredWorktrees maps git worktree list linux paths back to UNC with linuxPathToUnc.
--git-common-dir returns a linux path, and path.win32.resolve(UNC, "/home/...") turns it into the UNC repo path. Checked by hand.
Later git calls are routed through wsl.exe by resolveGitCommand.
Test coverage is in branch coder/p2-include-wsl-worktree-roots-in-orphan--5643f1, commit 12db5ac. It adds a retention test on a non-owned root: a clean settled worktree past keep-N is reclaimed, and the dirty and working ones are kept. The WSL roots go through this same code path, and worktree-wsl.test.js already covers the root enumeration. Orphan classification in a non-owned root was already covered by "sweeps only registered app worktrees in a custom root". The native Windows and macOS root is unchanged: it is still the only app-owned root.
Not covered: nothing runs against a real \\wsl$ distro. That needs a Windows+WSL machine.
Activity
currentbits commentedon Oct 1, 2026
Isolated path probe:
resolveWorktreeDir({path: '\\\\wsl.localhost\\Ubuntu\\home\\user\\repo'}, 'C:\\Users\\user\\AppData\\Solenta\\worktrees', 'thread-1', 'win32')returns the UNC directory\\\\wsl.localhost\\Ubuntu\\home\\user\\.solenta\\worktrees\\thread-1and Linux add path/home/user/.solenta/worktrees/thread-1. The returned directory is outside the base passed to both GC scanners. This probe checks path routing only; it is not a Windows end-to-end GC run.feat(worktrees): choose where new worktrees are created (#1531)
Choose the worktree location; solenta.json onSettle (#1531) (#1544)
currentbits commentedon Oct 13, 2026
The change itself is already on main. It landed in 70b5595 (#1544, part of #1531).
worktreeRootsinelectron/worktrees-gc.jsnow adds the WSL rootsresolveWorktreeDiruses, including/tmp/solenta-worktreesfor mounted repos, as non-app-owned roots. Three things use it: the boot orphan sweep,gcScan(the GC view's usage) andenforceRetention(the periodic sweeper). In a non-owned root, GC only considers dirs named like a thread id that are registered linked worktrees of a known project, and it never force-removes a dir git can't read.Traced on win32:
registeredWorktreesmapsgit worktree listlinux paths back to UNC withlinuxPathToUnc.--git-common-dirreturns a linux path, andpath.win32.resolve(UNC, "/home/...")turns it into the UNC repo path. Checked by hand.wsl.exebyresolveGitCommand.Test coverage is in branch
coder/p2-include-wsl-worktree-roots-in-orphan--5643f1, commit 12db5ac. It adds a retention test on a non-owned root: a clean settled worktree past keep-N is reclaimed, and the dirty and working ones are kept. The WSL roots go through this same code path, andworktree-wsl.test.jsalready covers the root enumeration. Orphan classification in a non-owned root was already covered by "sweeps only registered app worktrees in a custom root". The native Windows and macOS root is unchanged: it is still the only app-owned root.Not covered: nothing runs against a real
\\wsl$distro. That needs a Windows+WSL machine.test(gc): retention reclaims clean settled worktrees in non-owned (WS…
currentbits commentedon Oct 13, 2026
Landed from Solenta thread "P2: Include WSL worktree roots in orphan sweep and retention" (PR #1623). Closed on merge.
feat(worktrees): choose where new worktrees are created (#1531)
test(gc): retention reclaims clean settled worktrees in non-owned (WS…