anomalyco / anomalyco/opencode

subagent: spawns fail with "The provider response ended with an unknown finish reason"

Open
#44,695 1 comment 0 reactions 1 assignee View on GitHub

@jlongster is already working on this.

Since Aug 24, 2026.

2.0
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

  1. Spawn 3-5 subagents in parallel (e.g. explore with distinct prompts).
  2. Observe that one or more fail immediately with session.stream: The provider response ended with an unknown finish reason.
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.