Skip to content

Subagent tool calls silently abort with MessageAbortedError (zero response tokens) on custom Anthropic provider — 1.18.4+ #39456

Closed as not planned

Description

@Maizify

Description

Environment

  • macOS: 15.7.7
  • Node.js: v24.13.1
  • opencode: 1.18.4, 1.18.8, 1.18.9 (occasional success on 1.18.3; 100% reproducible from 1.18.4)
  • Custom provider: Anthropic protocol, model deepseek-v4-pro

Problem

When the main agent spawns a subagent via the task tool, the subagent receives its prompt normally and decides to call a tool (e.g. read, glob, grep). At that point the tool call never completes — it hangs with "Tool execution aborted" (MessageAbortedError) until the subagent times out. The subagent produces no output and the main agent receives nothing back, silently degrading the task.

Main-agent tool calls in the same session work fine. Only subagent tool execution is affected.

Evidence (from opencode.db)

  • message table: All aborted messages show {input: 0, output: 0} tokens — opencode dispatched the API request but never received any response tokens.
  • part table tool stats: Main agent — 6957 completed. Subagent — 2073 completed / 65 errors, of which 47 are "Tool execution aborted" (5–53 minute hangs).
  • Intermittent: Failures and successes interleave within the same parent session. Retrying the same subagent task often succeeds immediately.
  • Skewed distribution: 79% of failures came from one parent session (768 messages, 631 tool calls, ~165 hours alive). However, another parent with 5000+ messages and 4000+ tool calls had zero subagent failures — session size alone is not sufficient.
  • Concurrent correlation: Multiple failure timestamps coincide with parent task tool errors, suggesting parent session state propagates to child subagents.

Hypothesis

Client-side race condition or connection issue in the subagent subsystem. The request is dispatched but opencode never receives any response tokens. Long-lived parent sessions and heavy tool usage increase the probability, but the intermittent nature suggests a timing issue rather than a deterministic threshold.

Plugins

No response

OpenCode version

1.18.9

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. github-actions commented on Jul 29, 2026

    @github-actions
    Contributor

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

  2. github-actions commented on Sep 28, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions