summaryrefslogtreecommitdiff
path: root/makima/src/server/handlers/mesh_supervisor.rs
diff options
context:
space:
mode:
Diffstat (limited to 'makima/src/server/handlers/mesh_supervisor.rs')
-rw-r--r--makima/src/server/handlers/mesh_supervisor.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/makima/src/server/handlers/mesh_supervisor.rs b/makima/src/server/handlers/mesh_supervisor.rs
index 24ba4bb..1a2e47f 100644
--- a/makima/src/server/handlers/mesh_supervisor.rs
+++ b/makima/src/server/handlers/mesh_supervisor.rs
@@ -36,6 +36,10 @@ pub struct SpawnTaskRequest {
pub checkpoint_sha: Option<String>,
/// Repository URL for the task (optional - if not provided, will be looked up from contract).
pub repository_url: Option<String>,
+ /// If true, create a separate worktree for the task (requires merge after).
+ /// If false (default), the task shares the supervisor's worktree.
+ #[serde(default)]
+ pub use_own_worktree: bool,
}
/// Request to wait for task completion.
@@ -406,6 +410,8 @@ pub async fn try_start_pending_task(
patch_data,
patch_base_sha,
local_only: contract.local_only,
+ // For retried tasks, use their own worktree (they already have state from previous attempt)
+ supervisor_worktree_task_id: None,
};
if let Err(e) = state.send_daemon_command(daemon.id, cmd).await {
@@ -720,6 +726,8 @@ pub async fn spawn_task(
patch_data: None,
patch_base_sha: None,
local_only: contract.local_only,
+ // Share supervisor's worktree by default; separate worktree only when explicitly requested
+ supervisor_worktree_task_id: if request.use_own_worktree { None } else { Some(supervisor_id) },
};
if let Err(e) = state.send_daemon_command(daemon.id, cmd).await {
@@ -2248,6 +2256,7 @@ pub async fn resume_supervisor(
patch_data,
patch_base_sha,
local_only: contract.local_only,
+ supervisor_worktree_task_id: None, // Supervisor uses its own worktree
};
if let Err(e) = state.send_daemon_command(target_daemon_id, command).await {