anomalyco / anomalyco/opencode

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

Open
#39,456 1 comment 0 reactions 1 assignee View on GitHub

@kitlangton is already working on this.

Since Jul 29, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

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

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.