diff options
| author | soryu <soryu@soryu.co> | 2026-02-15 16:14:34 +0000 |
|---|---|---|
| committer | soryu <soryu@soryu.co> | 2026-02-15 16:14:34 +0000 |
| commit | 59c112e0b0eed31b20b0bda51eba63e673b46e5d (patch) | |
| tree | e0e78c569bf9d594a4a66970abf227ecf1a014bc | |
| parent | 33a16597aaca4179707d66e5052d4512218627c6 (diff) | |
| download | soryu-59c112e0b0eed31b20b0bda51eba63e673b46e5d.tar.gz soryu-59c112e0b0eed31b20b0bda51eba63e673b46e5d.zip | |
Close stdin for directive tasks
| -rw-r--r-- | makima/src/daemon/task/manager.rs | 15 |
1 files 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"); } } |
