From 59c112e0b0eed31b20b0bda51eba63e673b46e5d Mon Sep 17 00:00:00 2001 From: soryu Date: Sun, 15 Feb 2026 16:14:34 +0000 Subject: Close stdin for directive tasks --- makima/src/daemon/task/manager.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/makima/src/daemon/task/manager.rs b/makima/src/daemon/task/manager.rs index 76138c1..2a92d73 100644 --- a/makima/src/daemon/task/manager.rs +++ b/makima/src/daemon/task/manager.rs @@ -5193,18 +5193,17 @@ impl TaskManagerInner { // Check if this is a "result" message indicating task completion // With --input-format=stream-json, Claude waits for more input after completion if line.json_type.as_deref() == Some("result") { - if autonomous_loop { - // In autonomous loop mode, close stdin to let the process exit - // so we can spawn the next iteration with --continue - tracing::info!(task_id = %task_id, "Received result message in autonomous loop, closing stdin to signal completion"); + if is_supervisor { + // Supervisors keep stdin open — they wait for follow-up instructions + tracing::info!(task_id = %task_id, "Received result message in supervisor, keeping stdin open"); + } else { + // All other tasks (directives, contracts, autonomous loop iterations): + // close stdin so the process exits and the task completes. + tracing::info!(task_id = %task_id, "Received result message, closing stdin to signal completion"); let mut stdin_guard = stdin_handle_for_completion.lock().await; if let Some(mut stdin) = stdin_guard.take() { let _ = stdin.shutdown().await; } - } else { - // In interactive mode, keep stdin open so the user can send - // follow-up messages. Claude will stay alive waiting for input. - tracing::info!(task_id = %task_id, "Received result message, keeping stdin open for interactive input"); } } -- cgit v1.2.3