Skip to content

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

Closed as not planned

Description

@jc0d35

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.

Activity

  1. github-actions commented on Aug 24, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If your issue is specifically about the intermittent/concurrency aspect (more failures under parallel spawns), it may still be worth keeping open as a separate signal, but please review the above and comment if one of them already covers your case.

  2. neriousy commented on Oct 22, 2026

    @neriousy
    Member

    Closing this: on current V2, an unknown finish reason from the provider is treated as an incomplete stream and retried automatically when no output has started yet (packages/core/src/session/runner/step.ts, #51635). That should cover subagent spawns failing this way. If parallel spawns still fail with this error on a current build, comment here with the version and provider and we'll reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions