Skip to content

fix(server): storage cleanup no longer fails on a worktree folder without .git - #14

Merged
GwydionBr merged 2 commits into
mainfrom
fix/storage-cleanup-missing-git
Oct 12, 2026
Merged

GwydionBr merged 2 commits into
mainfrom
fix/storage-cleanup-missing-git

Conversation

@GwydionBr

Copy link
Copy Markdown
Owner

A folder in the managed worktrees directory whose .git file is gone (here: a leftover of deleted threads that only contained .DS_Store and an empty supabase/snippets/) made every storage cleanup sweep fail with NotFound: FileSystem.stat (…/.git), and the user saw a cleanup error each time.

The linked-worktree check now treats a missing .git like any other non-linked checkout and keeps the folder with the reason "Not a linked worktree". It is still never removed automatically, since without .git the cleanup cannot prove it is a worktree.

Test: keeps a leftover folder whose .git is gone instead of failing in storageCleanup.test.ts. The existing aggregates expired artifacts and rotated logs… test already fails on main and is unrelated.

Claude Opus 5.5 via Claude Code in T3 Code.

🤖 Generated with Claude Code

GwydionBr and others added 2 commits October 11, 2026 23:46
…hout .git

A leftover folder in the worktrees directory whose .git file is gone made
every cleanup sweep report a NotFound failure from FileSystem.stat. Treat a
missing .git like any other non-linked checkout and keep the folder.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Other stat failures, such as a permission error, are reported as a cleanup
failure again instead of as a non-linked worktree.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@GwydionBr
GwydionBr merged commit afd1488 into main Oct 12, 2026
1 check passed
@GwydionBr
GwydionBr deleted the fix/storage-cleanup-missing-git branch October 12, 2026 08:58
GwydionBr added a commit that referenced this pull request Oct 16, 2026
Storage cleanup now follows upstream, which handles worktrees shared by
subagents on its own (pingdotgg#19748, pingdotgg#19749). Only the missing-.git guard from #14
stays on top. Branch adoption in ThreadPullRequestService is kept and uses
the new crypto.randomUUIDv4() call. Branch-group sidebar code is kept with
upstream's pruned comments, and its header focus ring is now inset for the
new lint rule.

Co-Authored-By: Claude Opus 5.5 <[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