fix(kanban): sweep deferred scratch parent on non-scratch child completion + tests
Follow-up on the deferred-cleanup salvage (#33774): _cleanup_workspace returned early for a non-scratch ('dir'/'worktree') task and never ran the parent sweep, so a scratch parent waiting on a 'dir' child would leak its deferred workspace forever. Run the parent sweep before the early return. Adds regression tests: deferred-while-child-active, swept-after-last-child, and dir-child-unblocks-scratch-parent.
This commit is contained in:
@@ -3838,6 +3838,10 @@ def _cleanup_workspace(conn: sqlite3.Connection, task_id: str) -> None:
|
||||
kind: Optional[str] = row["workspace_kind"]
|
||||
path: Optional[str] = row["workspace_path"]
|
||||
if kind != "scratch" or not path:
|
||||
# This task's own workspace isn't a removable scratch dir, but its
|
||||
# completion may still unblock a deferred parent scratch cleanup
|
||||
# (e.g. a 'dir' child whose scratch parent was waiting on it). #33774
|
||||
_try_cleanup_parent_workspaces(conn, task_id)
|
||||
return
|
||||
# Check if this task has children that still need the workspace.
|
||||
# If any child is not yet done/archived, defer cleanup so the
|
||||
|
||||
Reference in New Issue
Block a user