Skip to content

opencode orchestrator: AO delivers no turns (empty session on spawn; ao send silently no-ops) #2115

@chetwerikoff

Description

@chetwerikoff

Environment

  • @aoagents/ao 0.9.2
  • Agent runtime: opencode, configured as the orchestrator agent
  • Model: deepseek (via opencode --model)
  • OS: Linux (WSL2); tmux runtime

Summary

When opencode is configured as the orchestrator agent, AO never delivers a turn to it:

  1. On spawn the opencode session starts empty (messages: [], 0 input tokens) — no kickoff turn, so the orchestrator never starts its loop.
  2. ao send <orchestrator> "..." reports success but the message never appears in the opencode session.

The orchestrator prompt itself is delivered (written to workspace AGENTS.md) and is proven loaded — but with no turn ever submitted, the agent just sits idle.

Steps to reproduce

  1. Configure the orchestrator with agent: opencode (+ a model).
  2. Start AO and let it spawn the orchestrator.
  3. Inspect/export the opencode session → empty, 0 input tokens.
  4. ao send <orchestrator-session> "ping" → AO reports sent; re-inspect → still empty.

Expected

  • Orchestrator receives a kickoff turn on spawn and begins its loop.
  • ao send delivers a user turn that appears in the opencode session.

Actual

  • Empty session on spawn; ao send silently no-ops.

Evidence / likely root cause

Two independent gaps, both pointing at the same missing capability — AO has no working "inject a user turn" primitive for an attached opencode TUI session:

  1. Bootstrap (no kickoff turn). ao-plugin-agent-opencode/dist/index.js injects a turn only when config.prompt is set (--prompt on the resumed opencode --session …). It does not read config.systemPromptFile. For the orchestrator, AO delivers the prompt via AGENTS.md / systemPromptFile, not config.prompt, so the launch command injects no turn.

  2. Send. ao send ends up on the generic runtime transport (tmux paste-buffer + send-keys into the pane running the full-screen opencode --session TUI). The opencode TUI does not consume the pasted buffer as a submitted turn, so nothing lands. The opencode agent plugin defines no sendMessage / turn-injection method of its own.

The native path works. opencode run --session <id> --model <model> "<msg>" delivers reliably — the message lands and the model responds (verified: session input jumped to ~20.7k tokens once a turn was submitted this way). So the session and the AGENTS.md prompt context are fine; only AO's delivery transport is at fault.

Suggested fix

Deliver orchestrator/agent turns to opencode via opencode run --session <id> (the native, working path) instead of tmux TUI paste — for both the initial kickoff and ao send. opencode already exposes session state via opencode session list (updated/updatedAt), which AO uses for activity detection, so delivery confirmation still works.

Workaround

A local PATH shim that replaces the interactive opencode --session with a stdin → opencode run --session bridge restores both the kickoff turn and ao send, without patching AO.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions