From 339c1769379a851c4126021132573bd4b7994cf2 Mon Sep 17 00:00:00 2001 From: soryu Date: Mon, 9 Feb 2026 15:55:01 +0000 Subject: Set directive env vars correctly for daemon --- makima/src/server/handlers/contract_chat.rs | 1 + makima/src/server/handlers/mesh.rs | 6 ++++++ makima/src/server/handlers/mesh_chat.rs | 1 + makima/src/server/handlers/mesh_supervisor.rs | 3 +++ makima/src/server/state.rs | 3 +++ 5 files changed, 14 insertions(+) (limited to 'makima/src/server') diff --git a/makima/src/server/handlers/contract_chat.rs b/makima/src/server/handlers/contract_chat.rs index 2c7a800..5d8ab3e 100644 --- a/makima/src/server/handlers/contract_chat.rs +++ b/makima/src/server/handlers/contract_chat.rs @@ -1610,6 +1610,7 @@ async fn handle_contract_request( local_only, auto_merge_local, supervisor_worktree_task_id: None, // Not spawned by supervisor + directive_id: task.directive_id, }; if let Err(e) = command_sender.send(command).await { diff --git a/makima/src/server/handlers/mesh.rs b/makima/src/server/handlers/mesh.rs index 5572d95..eb87e17 100644 --- a/makima/src/server/handlers/mesh.rs +++ b/makima/src/server/handlers/mesh.rs @@ -709,6 +709,7 @@ pub async fn start_task( local_only, auto_merge_local, supervisor_worktree_task_id: None, // Not spawned by supervisor + directive_id: task.directive_id, }; tracing::info!( @@ -764,6 +765,7 @@ pub async fn start_task( local_only, auto_merge_local, supervisor_worktree_task_id: None, // Not spawned by supervisor + directive_id: task.directive_id, }; if state.send_daemon_command(alt_daemon_id, alt_command).await.is_ok() { @@ -1181,6 +1183,7 @@ pub async fn send_message( local_only, auto_merge_local, supervisor_worktree_task_id: None, // Not spawned by supervisor + directive_id: updated_task.directive_id, }; if state.send_daemon_command(new_daemon_id, spawn_cmd).await.is_ok() { @@ -2825,6 +2828,7 @@ pub async fn reassign_task( local_only, auto_merge_local, supervisor_worktree_task_id: None, // Not spawned by supervisor + directive_id: task.directive_id, }; tracing::info!( @@ -3165,6 +3169,7 @@ pub async fn continue_task( local_only, auto_merge_local, supervisor_worktree_task_id: None, // Not spawned by supervisor + directive_id: task.directive_id, }; tracing::info!( @@ -4097,6 +4102,7 @@ pub async fn branch_task( local_only: false, // No contract, so not local_only auto_merge_local: false, // No contract, so no auto_merge_local supervisor_worktree_task_id: None, // Not spawned by supervisor + directive_id: None, }; if let Err(e) = state.send_daemon_command(target_daemon_id, command).await { diff --git a/makima/src/server/handlers/mesh_chat.rs b/makima/src/server/handlers/mesh_chat.rs index cf56ab6..638a4d3 100644 --- a/makima/src/server/handlers/mesh_chat.rs +++ b/makima/src/server/handlers/mesh_chat.rs @@ -1169,6 +1169,7 @@ async fn handle_mesh_request( local_only, auto_merge_local, supervisor_worktree_task_id: None, // Not spawned by supervisor + directive_id: task.directive_id, }; match state.send_daemon_command(target_daemon_id, command).await { diff --git a/makima/src/server/handlers/mesh_supervisor.rs b/makima/src/server/handlers/mesh_supervisor.rs index 8bf2534..c9cb849 100644 --- a/makima/src/server/handlers/mesh_supervisor.rs +++ b/makima/src/server/handlers/mesh_supervisor.rs @@ -410,6 +410,7 @@ pub async fn try_start_pending_task( auto_merge_local: contract.auto_merge_local, // For retried tasks, use their own worktree (they already have state from previous attempt) supervisor_worktree_task_id: None, + directive_id: updated_task.directive_id, }; if let Err(e) = state.send_daemon_command(daemon.id, cmd).await { @@ -732,6 +733,7 @@ pub async fn spawn_task( auto_merge_local: contract.auto_merge_local, // All tasks share the supervisor's worktree supervisor_worktree_task_id: Some(supervisor_id), + directive_id: updated_task.directive_id, }; if let Err(e) = state.send_daemon_command(daemon.id, cmd).await { @@ -2239,6 +2241,7 @@ pub async fn resume_supervisor( local_only: contract.local_only, auto_merge_local: contract.auto_merge_local, supervisor_worktree_task_id: None, // Supervisor uses its own worktree + directive_id: supervisor_task.directive_id, }; if let Err(e) = state.send_daemon_command(target_daemon_id, command).await { diff --git a/makima/src/server/state.rs b/makima/src/server/state.rs index ba9f9cf..58e8545 100644 --- a/makima/src/server/state.rs +++ b/makima/src/server/state.rs @@ -280,6 +280,9 @@ pub enum DaemonCommand { /// Task ID to share worktree with (supervisor's task ID). If Some, use that task's worktree instead of creating a new one. #[serde(rename = "supervisorWorktreeTaskId", default, skip_serializing_if = "Option::is_none")] supervisor_worktree_task_id: Option, + /// Directive ID if this task is associated with a directive + #[serde(rename = "directiveId", default, skip_serializing_if = "Option::is_none")] + directive_id: Option, }, /// Pause a running task PauseTask { -- cgit v1.2.3