From b6f239c19f0d3130515f3745f842e17a69212295 Mon Sep 17 00:00:00 2001 From: soryu Date: Tue, 27 Jan 2026 11:03:45 +0000 Subject: Add patch merging and fix task healthcheck failing due to worktrees --- makima/src/daemon/ws/protocol.rs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'makima/src/daemon/ws') diff --git a/makima/src/daemon/ws/protocol.rs b/makima/src/daemon/ws/protocol.rs index 6e4f5cf..bd13975 100644 --- a/makima/src/daemon/ws/protocol.rs +++ b/makima/src/daemon/ws/protocol.rs @@ -380,6 +380,23 @@ pub enum DaemonMessage { /// Error message if failed error: Option, }, + + /// Request to merge a task's patch to supervisor's worktree (cross-daemon case). + /// Sent when a task completes on a different daemon than its supervisor. + MergePatchToSupervisor { + /// The task that completed. + #[serde(rename = "taskId")] + task_id: Uuid, + /// The supervisor task to merge into. + #[serde(rename = "supervisorTaskId")] + supervisor_task_id: Uuid, + /// Base64-gzipped patch data. + #[serde(rename = "patchData")] + patch_data: String, + /// Base commit SHA for the patch. + #[serde(rename = "baseSha")] + base_sha: String, + }, } /// Information about a branch (used in BranchList message). @@ -737,6 +754,23 @@ pub enum DaemonCommand { /// Restart the daemon process. RestartDaemon, + + /// Apply a patch to a task's worktree (for cross-daemon merge). + /// Sent by server when routing MergePatchToSupervisor to the supervisor's daemon. + ApplyPatchToWorktree { + /// Target task whose worktree should be patched. + #[serde(rename = "targetTaskId")] + target_task_id: Uuid, + /// Source task that generated the patch (for logging). + #[serde(rename = "sourceTaskId")] + source_task_id: Uuid, + /// Base64-gzipped patch data. + #[serde(rename = "patchData")] + patch_data: String, + /// Base commit SHA for the patch. + #[serde(rename = "baseSha")] + base_sha: String, + }, } impl DaemonMessage { -- cgit v1.2.3