Workspace tools: stop_workspace, delete_workspace #157
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#157
Loading…
Add table
Add a link
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?
The two workspace-lifecycle operations that need no vault key — verified:
stopWorkerandremoveWorkertake nomasterKey, whilespawnWorkerandstartWorkerdo (those are slice 2, #159).Depends on #154. Scope:
nexus:write.stop_workspaceWraps
stopWorker.Note the asymmetry it creates and reflect it in the tool's output:
stopWorkerwritesworkers.statusand never touches a session row, so every session of a stopped workspace still readsstatus: 'running'while its probe reports the container down. That is exactly the trap #155's roll-up has to handle — do not let this tool report those sessions as healthy.Once stopped, the workspace cannot be restarted through MCP until slice 2, because
startWorkerneeds the vault key. Say so in the tool description rather than letting Claude discover it by failing.delete_workspaceWraps
removeWorker, and removal is asynchronous (AGENTS.md fact #27).DELETE /api/workers/:idcallsbeginRemoval(row →removing), returns 202, and reaps in the background; the row hard-deletes itself at the end, soremovingis the one phase that ends with the row disappearing.The tool reports accepted, never gone. Measured:
docker volume rmruns at ~4s per 50k files, so a clone withnode_modulesper worktree is tens of seconds. A tool that claims completion on return is lying for most of that window, and the natural follow-up — Claude immediately listing workspaces and still seeing it — reads as a bug.isRunningis false whileremoving, so a listing during teardown should show it as going away rather than as a running workspace with a failing health entry.A failed teardown parks in
remove-error, a phase distinct fromerror. Don't collapse them:erroris whatretryWorkeraccepts, and offering to re-provision a workspace whose removal failed means an empty re-clone against a half-reaped volume.Watch for
Both tools are destructive and reachable from a phone. The consent screen already lists "Stop and delete workspaces" as a granted capability, but consider whether
delete_workspaceshould require confirmation in its description so the model treats it as weightier thanstop_workspace.Done when
Claude can stop and delete a workspace; the delete returns promptly with an accepted-not-done result; and a listing during teardown reports the workspace as being removed rather than as running-and-unhealthy.