Skip to content

Permission prompts from nested subagents are never shown and the tool call hangs #30635

Closed as not planned

Description

@literally-dan

Description

When a subagent spawns its own subagent, any permission or question prompt raised inside that nested subagent is never shown. The prompt carries the deepest session's id, but every UI consumer only recognizes the sessions it directly tracks, so the prompt is published to the bus and then dropped.

On the server side the Permission.ask deferred never resolves, so any tool that goes through ctx.ask hangs forever. That includes every MCP tool, which is where this usually surfaces: it looks like "MCP auth fails" or an MCP tool that just never returns.

This affects the TUI, opencode run, and the ACP integration, since each one decides which prompts are "mine" by checking the sessions it directly tracks rather than the whole descendant tree.

This is distinct from #16491, where subagent MCP tools are blocked by a missing permission grant and denied at execution. Here the prompt is never routed to any UI, so the call hangs rather than being denied.

I have a fix that routes these prompts to the ancestor session the UI actually knows about.

Plugins

None

OpenCode version

1.15.13

Steps to reproduce

  1. Run a session that spawns a subagent, and have that subagent spawn another subagent (two levels deep).
  2. Have the deepest subagent call a tool that needs a permission prompt: an MCP tool, or bash with a pattern that isn't pre-approved.
  3. No prompt appears, and the tool call hangs indefinitely.

Screenshot and/or share link

No response

Operating System

Linux 6.17.0-29-generic

Terminal

foot

Activity

  1. github-actions commented on Jun 3, 2026

    @github-actions
    Contributor

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

    If your issue is distinct (e.g., your fix addresses something these don't), please clarify the difference so we can keep this open.

  2. literally-dan commented on Jun 3, 2026

    @literally-dan
    Author

    Closing as a duplicate of #13715, which describes the same nested-subagent permission hang and came first. Tracking the fix there.

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