fix: orchestrator exits immediately when using Claude Code harness #3

Closed
nick-the-dev wants to merge 1 commit from fix/claude-orchestrator-exit into main
nick-the-dev commented 2026-03-19 20:53:10 +00:00 (Migrated from github.com)

Problem

When Claude Code is the selected harness, superharness exits immediately after the orchestrator processes its initial prompt. The user sees:

open terminal failed: not a terminal
Error: tmux attach failed

Root Cause

Both the orchestrator (session.rs) and workers (panes.rs) use the same build_harness_cmd function, which passes --print to Claude Code. The --print flag runs Claude in non-interactive mode — it processes the prompt, prints output, and exits.

This is correct for workers (run a task and exit), but wrong for the orchestrator which needs to stay alive interactively for the human to communicate with it.

Fix

Added a new build_orchestrator_cmd function in harness.rs that omits --print for Claude Code, passing the prompt as a positional argument instead. This keeps the orchestrator session interactive.

Pane Function Claude command
Worker build_harness_cmd claude --dangerously-skip-permissions --print <prompt>
Orchestrator build_orchestrator_cmd claude --dangerously-skip-permissions <prompt>

Workers continue to use build_harness_cmd with --print as intended.

Changes

  • src/harness.rs: Added build_orchestrator_cmd for interactive orchestrator sessions
  • src/tmux/session.rs: Orchestrator init now calls build_orchestrator_cmd instead of build_harness_cmd
## Problem When Claude Code is the selected harness, superharness exits immediately after the orchestrator processes its initial prompt. The user sees: ``` open terminal failed: not a terminal Error: tmux attach failed ``` ## Root Cause Both the orchestrator (`session.rs`) and workers (`panes.rs`) use the same `build_harness_cmd` function, which passes `--print` to Claude Code. The `--print` flag runs Claude in non-interactive mode — it processes the prompt, prints output, and exits. This is correct for **workers** (run a task and exit), but wrong for the **orchestrator** which needs to stay alive interactively for the human to communicate with it. ## Fix Added a new `build_orchestrator_cmd` function in `harness.rs` that omits `--print` for Claude Code, passing the prompt as a positional argument instead. This keeps the orchestrator session interactive. | Pane | Function | Claude command | |------|----------|---------------| | Worker | `build_harness_cmd` | `claude --dangerously-skip-permissions --print <prompt>` | | Orchestrator | `build_orchestrator_cmd` | `claude --dangerously-skip-permissions <prompt>` | Workers continue to use `build_harness_cmd` with `--print` as intended. ## Changes - `src/harness.rs`: Added `build_orchestrator_cmd` for interactive orchestrator sessions - `src/tmux/session.rs`: Orchestrator init now calls `build_orchestrator_cmd` instead of `build_harness_cmd`
backmeupplz commented 2026-03-23 13:37:57 +00:00 (Migrated from github.com)

Thanks for the PR! This was already fixed in main — we split the orchestrator and worker command paths so the orchestrator no longer gets --print when using Claude Code. Closing as already resolved, but really appreciate the clean write-up and diagnosis!

Thanks for the PR! This was already fixed in main — we split the orchestrator and worker command paths so the orchestrator no longer gets `--print` when using Claude Code. Closing as already resolved, but really appreciate the clean write-up and diagnosis!

Pull request closed

Sign in to join this conversation.
No description provided.