From 7af8561677cfdcfd23d099a25783c7fef51d1ba6 Mon Sep 17 00:00:00 2001 From: soryu Date: Thu, 29 Jan 2026 02:30:16 +0000 Subject: Fix worktree cleanup to not run for shared worktrees --- makima/src/db/repository.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'makima/src/db/repository.rs') diff --git a/makima/src/db/repository.rs b/makima/src/db/repository.rs index 7c9154f..b947cdd 100644 --- a/makima/src/db/repository.rs +++ b/makima/src/db/repository.rs @@ -691,9 +691,9 @@ pub async fn create_task(pool: &PgPool, req: CreateTaskRequest) -> Result Result, pub overlay_path: Option, + /// If set, this task shares the worktree of the specified supervisor task. + /// Should NOT have its worktree deleted during cleanup. + pub supervisor_worktree_task_id: Option, } /// List tasks in a contract with their daemon/worktree info. @@ -2755,7 +2760,7 @@ pub async fn list_contract_tasks_with_worktree_info( ) -> Result, sqlx::Error> { sqlx::query_as::<_, TaskWorktreeInfo>( r#" - SELECT id, daemon_id, overlay_path + SELECT id, daemon_id, overlay_path, supervisor_worktree_task_id FROM tasks WHERE contract_id = $1 AND (daemon_id IS NOT NULL OR overlay_path IS NOT NULL) "#, -- cgit v1.2.3