diff options
| author | soryu <soryu@soryu.co> | 2026-01-27 01:25:29 +0000 |
|---|---|---|
| committer | soryu <soryu@soryu.co> | 2026-01-27 01:25:40 +0000 |
| commit | b0d0b4848b2fc8a44c2575e09a08b34aaf6e1484 (patch) | |
| tree | bd0dedfd8a3623d01f28ff590e97a028bc5456c5 /makima/src/server/handlers/mesh_supervisor.rs | |
| parent | b28345d15730ffbefe81244d06c06fe13c30b0ea (diff) | |
| download | soryu-b0d0b4848b2fc8a44c2575e09a08b34aaf6e1484.tar.gz soryu-b0d0b4848b2fc8a44c2575e09a08b34aaf6e1484.zip | |
Default to shared worktree and add worktree endpoint
Diffstat (limited to 'makima/src/server/handlers/mesh_supervisor.rs')
| -rw-r--r-- | makima/src/server/handlers/mesh_supervisor.rs | 9 |
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 { |
