You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
opencode run (headless) exits 0 mid-pipeline after a parallel subagent fan-out, before the model's next turn #37548
In headless mode, opencode run sometimes ends the session (exit code 0) immediately after a parallel task-tool subagent fan-out returns, before the primary model gets its next turn. The run looks successful but the output stops mid-pipeline — the model never processes the subagents' results.
Environment
opencode 1.16.2 and 1.18.2 (reproduced on both)
Linux (Ubuntu, kernel 6.17), zsh
Primary model opencode-go/glm-5.2 (build agent), custom subagents on opencode-go/* models
Repro shape
A custom command (/deep-research) loads a skill that instructs the model to run a multi-phase pipeline, dispatching parallel task-tool subagents at several phases (search → fetch → verify → synthesize).
opencode run "/deep-research <question>"
Observed three times across the two versions:
(1.16.2) All 10 parallel verify subagents completed (stderr progress shows every ✓) — the process exited 0 without the model's tally/synthesis turn ever running.
(1.16.2) Same run earlier needed a resume mid-pipeline as well.
(1.18.2) The run printed the model's Phase-1 text ("Dispatching 6 search agents in parallel"), dispatched them, and exited 0 — no Phase 2 onward.
When it happens, stdout ends mid-pipeline and the exit code is still 0, so scripts can't tell the run failed.
Expected
The session should continue until the primary model ends a turn with no pending subagent results to process.
Workaround
Resuming the same session continues correctly every time:
opencode run -s <session-id> "Continue exactly where you left off…"
(Note: must be run from the same working directory, since sessions are per-project.)
Happy to provide session exports for the affected runs if useful.
Activity
github-actions commentedon Sep 16, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.