-
Notifications
You must be signed in to change notification settings - Fork 66
worktree.remove kills a working agent, even when its task holds a lease #422
Copy link
Copy link
Closed
Labels
area: git and diffGit state, diffs, notes, and GitHub integrationGit state, diffs, notes, and GitHub integrationarea: orchestrationTasks, leases, boards, and worktreesTasks, leases, boards, and worktreesarea: workspacesWorkspace management and navigationWorkspace management and navigationplatform: linuxLinux-specific behaviorLinux-specific behaviorstatus: needs triageNeeds maintainer review and classificationNeeds maintainer review and classification
Description
Activity
Metadata
Metadata
Assignees
Labels
area: git and diffGit state, diffs, notes, and GitHub integrationGit state, diffs, notes, and GitHub integrationarea: orchestrationTasks, leases, boards, and worktreesTasks, leases, boards, and worktreesarea: workspacesWorkspace management and navigationWorkspace management and navigationplatform: linuxLinux-specific behaviorLinux-specific behaviorstatus: needs triageNeeds maintainer review and classificationNeeds maintainer review and classification
What happened?
luvus worktree removeremoved a worktree whose Codex worker was mid-turn (sleep 120in the foreground) and whose task held a path lease. It returned{"type":"ok"}, closed the workspace and killed the agent. The task stayedrunningwithassignee: None. These were the only events:I expected a refusal, as for a dirty tree (
git_error"…use --force"). The orchestration guide says to use this command to clean up a finished worker, but nothing checks that it has finished, so any client that cleans up by path can lose a running worker's work.Steps to reproduce
luvus workspace open <repo>, thenluvus task add "busy" --paths notes/busy.txt --prompt "Run in the foreground and wait for it: sleep 120. Then mark the task done."luvus task start t1 --agent "codex --dangerously-bypass-approvals-and-sandbox" --no-focusluvus agent get <pane>showsworking.luvus worktree remove ~/.luvus/worktrees/<repo>/luvus-t1Area
orchestration, workspaces, git and diff
Environment
luvus-bin), a named session driven over the CLI and UHP.luvus doctor: all checks pass.mainat732c81c,finish_explicit_worktree_removestill closes the workspace without any check.Anything else?
Proposal: refuse with something like
worktree_in_use, listing the pane ids, when a pane whose cwd is inside the path has aworkingorblockedagent, or holds a lease. Addforce: true(--forceon the CLI) to keep today's behaviour.Related: #389, #420
Related: #389, #420 (the sidebar deletion path). Client-side context: atqamz/hand#707 never calls
worktree.remove; it removes worktrees itself after checking for a live worker and uncommitted changes.