Skip to content

Nested Subagent Fails Silently in 3-Layer Deep Chain (Works Fine in 2-Layer) #23091

Closed as not planned

Description

@xsrtyq

Description

A subagent called at depth 3 (parent → child → grandchild) fails silently without any error message. The issue does not occur at depth 2 (parent → child). The problem began appearing on 2026-04-17, while everything worked normally the previous day.

The grandchild agent receives the prompt successfully (child session window appears), enters a "thinking" phase, and then abruptly terminates without any error or output — not even a single tool call or text response.

Plugins

none

OpenCode version

v1.4.7

Steps to reproduce

1.Create a main agent that uses the task tool to call a child subagent.

2.In the child subagent's prompt, instruct it to further call a grandchild subagent via the task tool.

3.Give the grandchild subagent a simple task (e.g., "read a file and summarize").

4.Observe the behavior: the grandchild subagent starts, thinks for a few seconds, then disappears with no error.

Screenshot and/or share link

Image

Operating System

Windows11

Terminal

Windows terminal

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 17, 2026
  2. removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  3. mguttmann commented on Jun 13, 2026

    @mguttmann

    We ran into this too. In our reference implementation (proposal #32166, PR #32167) the depth-3 silent failure is gone: the root cause on our side was task_id resume targeting a non-direct-child session, which produced an unparented/silent run. Resume is now restricted to direct children, and over-depth spawns fail loudly with a typed SubagentDepthError instead of dying silently — chains of 3+ levels (up to 5) work and are covered by tests.

  4. github-actions commented on Aug 13, 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