diff options
| author | soryu <soryu@soryu.co> | 2026-02-15 20:10:43 +0000 |
|---|---|---|
| committer | soryu <soryu@soryu.co> | 2026-02-15 20:10:43 +0000 |
| commit | e449d55e70453a28f1de6dc8ceccc0f23fcce4e1 (patch) | |
| tree | 6390592e2c6bb77c63cf54ffeaa31e4af0281bee | |
| parent | 59c112e0b0eed31b20b0bda51eba63e673b46e5d (diff) | |
| download | soryu-e449d55e70453a28f1de6dc8ceccc0f23fcce4e1.tar.gz soryu-e449d55e70453a28f1de6dc8ceccc0f23fcce4e1.zip | |
Close stdin for directive tasks
| -rw-r--r-- | makima/src/daemon/task/manager.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/makima/src/daemon/task/manager.rs b/makima/src/daemon/task/manager.rs index 2a92d73..9dc342e 100644 --- a/makima/src/daemon/task/manager.rs +++ b/makima/src/daemon/task/manager.rs @@ -5193,17 +5193,18 @@ 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 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"); + if autonomous_loop || directive_id.is_some() { + // Autonomous loop: close stdin so we can spawn the next iteration + // Directive tasks: close stdin so the process exits and the step completes + tracing::info!(task_id = %task_id, directive_id = ?directive_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 { + // Interactive mode (mesh, contracts): 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"); } } |
