delete_worktrees

Queue one background job that deletes worktree directories, each by the path its row decides.

WorktreewritesidempotentdestructiveCLI only

A directory whose agent is archived goes through delete_agents, which runs the workflow's teardown hooks and the cleanup and takes the agent's children with it; one nothing answers for, or whose agent's own delete failed on a registration git cannot read, goes through remove_unowned_worktrees; one whose agent is live is left alone. It answers once the job is recorded, before anything has gone. The directories leave list_worktrees as soon as the job is recorded. A directory the listing no longer holds is skipped, so a retried job takes only what is left, and one that is refused comes back to list_worktrees once the job is finished with, with the reason in the log.

Calling it#

curl -X POST http://127.0.0.1:8787/worktree.v1.WorktreeService/DeleteWorktrees \
  -H 'Content-Type: application/json' \
  -d '{
  "dirs": [
    "<dirs>"
  ]
}'

Request#

DeleteWorktreesRequest#

FieldTypeDescription
dirslist of string

The directories to delete, each as list_worktrees spelled it.

required

Response#

Empty#

No fields.