anomalyco / anomalyco/opencode
subagent: spawns fail with "The provider response ended with an unknown finish reason"
@jlongster is already working on this.
Since Aug 24, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Summary
Subagents (e.g. explore) intermittently fail at spawn with The provider response ended with an unknown finish reason. The session dies immediately with no further detail; a retry of the same prompt often succeeds. In one session, 3 of 5 concurrently-spawned explore agents failed this way; a second attempt got 2 of the remaining ones through, and one never succeeded after repeated tries. This makes parallel research via subagents unreliable.
Environment
- opencode version: opencode2 v0.0.0-beta-18050 (beta)
- OS: Linux 6.8.0-111-generic x86_64
- Terminal: tmux (TERM=tmux-256color)
- Shell: /bin/bash
- Install/channel: beta
- Active plugins: /home/cunabu/.config/opencode/plugins/cunabu-agent-git.mjs
- Model in use: opencode-go/deepseek-v4-pro (per opencode.json)
Reproduction
- Spawn 3-5 subagents in parallel (e.g.
explorewith distinct prompts). - Observe that one or more fail immediately with
session.stream: The provider response ended with an unknown finish reason. - Re-run the identical prompt; it often completes.
Expected Behavior
Subagents run, or fail with a normal refusal/stream error that carries a reason and retries cleanly.
Actual Behavior
Immediate failure at stream start with no finish-reason detail; outcome is effectively a coin flip per spawn.
Additional Context
- Fails at session start (no long-lived context involved); different prompts fail, so content is not the trigger.
- Intermittent across runs; more frequent under parallel spawns, so worth checking whether concurrency/connection reuse plays a part.
- No server/log snippet available in this environment beyond the quoted error.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.