worker-to-orchestrator messaging: ao send --steer fails with SESSION_MODE_MISMATCH; guessed worker-N-10 address resolves to reviewer sub-session that replies as the orchestrator
Summary
Worker sessions have no working bottom-up channel to deliver a message to the orchestrator: direct attempts either fail outright or (worse) land on the wrong addressee. As a result the orchestrator sees a "silent" worker and only learns about a finished report by manually reading the worker's transcript.
Observed on macOS, ao with the claude-code harness, a project with one orchestrator + several workers (sessions running in Terminal UI).
Bug 1: ao send --session <orchestrator> --steer fails with SESSION_MODE_MISMATCH
Repro:
- Project created via ao; orchestrator launched by ao (session id, e.g.
hhru-80, harness claude-code, Terminal UI). - From a worker session shell (e.g.
hhru-581) run:ao send --session hhru-80 --steer --message "Worker report: ..." - Result:
Exit code 1: this session was created in Terminal UI mode and has no chat conversation (SESSION_MODE_MISMATCH).
Expected: the orchestrator is a regular participant of the project's session graph; a worker must be able to deliver a message to it (queued into its console). Currently worker→orchestrator via the CLI does not work at all. worker→worker and orchestrator→worker do work.
Workaround used today: the orchestrator reads the worker's transcript directly (sqlite sessions.agent_session_id → jsonl under ~/.claude/projects/...). That is archaeology, not a channel.
Bug 2: a guessed address lands in a foreign sub-session, which then replies as the orchestrator
Repro:
- Worker
hhru-580has a cycle-review reviewer sub-session with the internal addresshhru-580-10(uds socket/tmp/cc-socks/<pid>.sock,from-name="hhru-580-10"). - The worker, not knowing the orchestrator's address, guesses a plausible one and sends
SendMessagetohhru-580-10. - The message is delivered to the reviewer sub-session; it (an LLM with full project context) replies in an orchestrator tone: "Report received, decisions recorded" — and the worker accepts that as the orchestrator's confirmation.
Consequences: decisions get "recorded" by a sub-agent that is not the orchestrator; the <session>-10 naming scheme makes such collisions likely. Expected: either the orchestrator's address is discoverable by workers (e.g. ao session orchestrator --project X plus explicit "reply only there"), or sub-session addresses are not resolvable for foreign SendMessage without an explicit reference.
Environment
- macOS (Darwin 25.6.0), ao daemon, claude-code harness (v2.1.278), 2026-09-20.
- Affected sessions: orchestrator
hhru-80(Terminal UI), workershhru-580,hhru-581. - Exact error:
this session was created in Terminal UI mode and has no chat conversation (SESSION_MODE_MISMATCH).
Proposed fix plan
Root cause: ao send --steer can only deliver into a "chat conversation"; the orchestrator session was created in Terminal UI where no conversation object exists → SESSION_MODE_MISMATCH. Meanwhile ao already has a mechanism for injecting a message into a live claude-code session: workers correctly receive incoming [from <session>] turns on the orchestrator→worker path. The fix is in the delivery transport, not in demanding a chat.
- Minimal bug fix: in the
ao sendhandler, when the target session is in Terminal UI, do not fail withSESSION_MODE_MISMATCH; deliver via the existing incoming-turn mechanism (pty console injection while the REPL is live) or a queued prompt picked up on the next idle. "No chat conversation" is a reason to pick a different transport, not to refuse delivery. - Discoverable orchestrator address:
ao session orchestrator --project <id>(or a field inao session ls) so workers stop guessing addresses (observed guesses:hhru-80,hhru-580-10). - Sub-session address hygiene: reviewer sub-sessions (
<worker>-10, uds/tmp/cc-socks/<pid>.sock) should not resolve for foreignSendMessagecalls without an explicit reference — otherwise the "reviewer sub-session replied as the orchestrator" collision will recur (observed:hhru-580-10answered workerhhru-580's report in an orchestrator tone, and the worker accepted it as owner confirmation).
The minimal change that removes the pain is №1.
The current ao send --steer path is Chat-only; that explains the TUI SESSION_MODE_MISMATCH. PR #5064 is active work on durable worker-to-orchestrator report delivery through ao report, including supported TUI targets. It does not change --steer or native guessed subagent addresses, so I am keeping this issue open while that PR is reviewed and the remaining behavior is assessed.