anomalyco / anomalyco/opencode

subagent questions lose their context in the root session

Open
#39,587 0 comments 2 reactions 1 assignee View on GitHub

@jlongster is already working on this.

Since Jul 30, 2026.

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

Description

Description

opencode2

This must be fixed in opencode2, even if it is not backported to v1.

When a subagent calls question, the root session renders only the interactive prompt. The findings or reasoning that made the question necessary remain in the subagent session. As a result, the user is asked to choose without the information needed to answer, especially when several subagents are active.

Expected behavior for v2:

  • question can carry a short contextual preface supplied by the caller.
  • The root session renders that preface as normal session output immediately before the interactive question.
  • The preface remains in the root transcript so the question is still understandable after it is answered.

Example:

dependency-review
package.json requests v5, but the lockfile resolves v4.3. Updating the lockfile may change transitive dependencies.

Question: Which source should be authoritative?

This issue is only about the human-facing context/presentation contract. Nested prompt routing and agent provenance are already tracked in #7654, #13715, and #39112. Agent-to-agent messaging is separate in #38963.

Plugins

No response

OpenCode version

1.18.7

Steps to reproduce
  1. Start a root session that launches one or more subagents.
  2. Have a subagent discover information that requires a user decision.
  3. Have the subagent call question.
  4. Observe that the root session receives the interactive question but not the subagent's supporting context as normal output.
  5. To answer safely, the user must open the child session or guess why the question was asked.
Screenshot and/or share link

No response

Operating System

macOS 26.2

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.