Deleting a session while its workspace is stopped orphans the worktree and branch #201
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lz/agent-nexus#201
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
deleteSession(nexus/src/lib/server/sessions/service.ts) runs its git cleanup only when the container is running:On a stopped workspace the row is hard-deleted and the worktree at
/workspace/.nexus/worktrees/<name>and its branch both stay on the volume, with nothing pointing at them:convergeSessionssees the worktree once the workspace starts again, logs a warning, and never imports it (fact #15), so it doesn't show up anywhere in the UI.createSession's recovery path whengit worktree add -bfails. That path runsworktree remove --force,branch -Dandrm -rfon the orphan, so any commits left on it are deleted silently. Nobody confirmed that, and nothing reports it.Options
nexus_delete_sessiondoes withoutforce(#156, specdocs/superpowers/specs/2026-09-23-mcp-session-tools-design.md), and the UI could do the same with a "start the workspace first" message.The same-name recovery path deserves a look either way: a create should not be able to destroy commits on a branch it did not make.
Found while designing #156.