agent-orchestrator icon indicating copy to clipboard operation
agent-orchestrator copied to clipboard

[Bug]: prime-agent worker never receives its prompt — session boots, then parks idle with no output

Open fusman60 opened this issue 4 weeks ago • 1 comments

What went wrong?

Workers spawned with the prime-agent harness never receive their prompt. The session boots successfully — prime-agent starts, loads the model and reports active — but the spawn prompt is never delivered into the PTY, so the worker parks forever with no output and no error.

AO reports the session as idle with an empty latest_assistant_update and an empty first_signal_at, so from the orchestrator's side this looks identical to a healthy idle worker that just hasn't been prompted. There is no timeout, no error, and no way to recover: ao send cannot re-deliver the prompt to a Terminal-UI session.

Steps to reproduce

  1. Configure a project whose worker harness is prime-agent (e.g. worker.agent: "prime-agent", worker.agentConfig.model: "minimax-cn/MiniMax-M2.7").
  2. Spawn a worker:
    ao spawn --project <project> --name "smoke-test" --agent prime-agent --prompt "Reply with exactly: REPRO_OK"
    
  3. Wait. The session is created and shows idle forever. No reply is ever produced.

Reproduced 2 out of 2 times.

Actual behavior

ao session get <id> reports:

status: idle
activity: idle
harness: prime-agent

with latest_assistant_update empty and first_signal_at empty, indefinitely.

The prime-agent session transcript contains only the five bootstrap events and zero message events:

$ jq -r '.type' ~/.ao/data/agent-runtime/prime-agent/sessions/<id>.jsonl | sort | uniq -c
   1 model_change
   1 service_tier_change
   1 session
   1 session_state
   1 thinking_level_change

A working prime-agent session (e.g. a human-driven one) contains many message events, so this confirms the prompt never reached the agent.

The prompt is recorded as delivered ~400 ms before the agent can read it

Timeline from a fresh spawn (UTC):

Timestamp Event
03:53:12.591 AO session row created
03:53:17.763 latest_user_prompt_at — AO records the prompt as delivered
03:53:18.168 prime-agent creates its session file
03:53:18.171 prime-agent session_state: active

AO records the prompt delivery roughly 400 ms before prime-agent's session (and therefore its TUI input handling) exists. This looks like a readiness race: the keystrokes are written to the PTY before the TUI starts reading stdin, and are dropped. Because prime-agent has no chat driver, there is no fallback path and no retry.

There is no way to recover or retry the delivery

$ ao spawn --mode chat --agent prime-agent ...
spawn: chat mode unsupported for harness: prime-agent has no chat driver (SESSION_MODE_UNSUPPORTED)

$ ao send --session <id> --steer --message "..."
this was created in Terminal UI mode and has no chat conversation (SESSION_MODE_MISMATCH)

So the spawn prompt written over the PTY is the only delivery channel, and it fails silently.

prime-agent itself is healthy — the fault is in AO's injection

The binary and its TUI both work:

$ prime-agent -p --mode text "Reply with exactly: PRIME_DIRECT_OK"
PRIME_DIRECT_OK

and prime-agent's TUI accepts programmatically injected keystrokes and answers correctly when driven through a PTY multiplexer:

  Say exactly TMUX_PRIME_OK
 TMUX_PRIME_OK

AO's worker pipeline works for other harnesses

The same spawn against the same project, with only the harness changed:

  • --agent claude-code --mode chat → WORKER_OK / Harness: Claude Code (SDK-TS entrypoint); Model: MiniMax-M2.7
  • --agent codex --mode chat → PROBE_OK

So the spawn → prompt → turn → reply path is healthy in general, and the failure is specific to how AO drives the prime-agent TUI.

Launch command

Taken from the live process table:

ao pty-host <session-id> <worktree> ao agent-process supervise --session <session-id> --launch <id> \
  -- /Users/farhan/.npm-global/bin/prime-agent \
     --session-dir /Users/farhan/.ao/data/agent-runtime/prime-agent/sessions \
     --append-system-prompt "## AO Worker Role ..."

Note that the task prompt is not passed as an argv message — it can only be injected over the PTY. A separate prime-agent --mode daemon --daemon-socket <path> process is also running; it is worth checking whether delivery is expected to go through that daemon socket rather than raw PTY keystrokes, and whether that path is being attempted and failing silently.

Impact

Any task delegated to a worker using prime-agent hangs indefinitely and silently. There is no user-visible error and no automatic demotion to a failed/stuck state.

Expected behavior

The spawn prompt reaches the prime-agent TUI (or its daemon socket), prime-agent executes the turn, and the session reports the assistant reply — as it does for the claude-code and codex harnesses.

Environment

  • AO 0.14.9, commit f9dc47270251, built 2026-11-04T07:46:32Z
  • macOS (Darwin 27.0.0, arm64)
  • prime-agent 0.10.2 (both ~/.local/bin/prime-agent and ~/.npm-global/bin/prime-agent resolve to the same binary)
  • Model: minimax-cn/MiniMax-M2.7

Related

  • #5487 — Chat default should fall back to Terminal UI for harnesses without a chat driver (prime-agent is one of them; here TUI is used correctly, but the delivery into it fails)
  • #7486 — no demotion of stale activity state for harnesses without a TerminalActivityDetector (prime-agent is listed there too, and that issue notes that per-harness detectors "change message-delivery readiness for that harness")

fusman60 avatar Nov 05 '26 04:11 fusman60

This is a bug report. Check that nobody has claimed it, comment to claim it, and open a PR with Fixes #7788.

See the contributing guide. Think the classification is wrong? Tell us on Discord.

OrcInc avatar Nov 05 '26 05:11 OrcInc