Worktrees
Worktrees are the checked-out working copies a project's tasks run in, one per slot on a node. These endpoints list the slots you can see, read one, free a slot held by a task, and delete a slot.
List worktrees
Lists the worktree slots the caller can see, ordered by project, slot number and node, with each slot's state, current task and node. Filter by `node_id`; `limit` caps the number of rows.
Delete slot row
Removes one worktree slot's record only: the node is not told, the directory stays and a runner in it keeps running. Requires worktree delete permission on the slot's project. Returns 204 with no body.
Get worktree
Returns one worktree slot by project name and slot number, with its state, current task and node. Pass `node_id` when the project has slots on several nodes; otherwise the first node by name is used. A slot the caller cannot see returns 404.
Retry slot destroy
Orders the removal of a worktree slot whose node failed, refused or never answered the previous order again. Requires worktree delete permission on the slot's project. Returns 409 when the slot is not being removed, else 204 with no body.
Erase slot
Deletes one worktree slot: ends the task or session holding it, removes the slot and asks its node to erase the directory, without refusing on occupancy. Requires worktree delete permission on the slot's project. Returns `row_deleted`, `node_erased`, the node's reason when the directory was left in place, and what was holding the slot.
Release worktree slot
Frees a worktree slot held by a task and stops the runner in it; the task is dispatched again, and the next lease discards uncommitted work in the slot. Returns 409 while a live session is attached unless `force` is true. Returns 204 with no body.