summaryrefslogtreecommitdiff
path: root/makima/src/daemon/task/manager.rs
diff options
context:
space:
mode:
Diffstat (limited to 'makima/src/daemon/task/manager.rs')
-rw-r--r--makima/src/daemon/task/manager.rs15
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");
}
}