anomalyco / anomalyco/opencode

Task tool can drop a completed subagent result after persistence

Open
#48,626 0 comments 0 reactions 1 assignee View on GitHub

@nexxeln is already working on this.

Since Sep 12, 2026.

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

Description

Description

When the Task tool invokes a subagent, the child can complete with finish: stop and persist a valid final JSON result, while the parent receives an empty or absent task result.

This differs from #38866 because there is no provider stream error, and from #37852 because the finish reason is not unknown. The child output exists and is complete; it is lost between child completion and parent delivery.

Expected: the parent receives the persisted subagent result.

Actual: the parent receives no usable result and treats the completed task as empty or malformed.

Plugins

A custom Task-based orchestration integration.

OpenCode version

1.18.30

Steps to reproduce

  1. Configure a subagent that returns a small valid JSON object.
  2. Invoke it through the Task tool from a parent session.
  3. Observe that the child session completes with finish: stop.
  4. Confirm that the valid JSON result is persisted in the child session.
  5. Observe that the parent receives an empty or absent task result.

The failure is intermittent, but the distinguishing evidence is that child completion and persistence succeed without a stream error.

Screenshot and/or share link

Not available.

Operating System

Windows 11

Terminal

OpenCode Desktop

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.