anomalyco / anomalyco/opencode

Permission prompts not propagated at subagent_depth 2 — subagent hangs waiting for approval

Open
#43,996 1 comment 1 reaction 1 assignee View on GitHub

@rekram1-node is already working on this.

Since Aug 21, 2026.

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

Description

Description

Description

When subagent_depth is set to 2, permission prompts (e.g., "ask" for bash)
from a depth-2 subagent never reach the user. The subagent hangs indefinitely
waiting for approval that never arrives.

Config

{
  "subagent_depth": 2,
  "permission": {
    "bash": { "*": "ask" }
  }
}

Reproduction Steps
1. Set subagent_depth: 2 in opencode.json
2. Set permission.bash: { "*": "ask" }
3. From primary agent, dispatch to a subagent(mode=all) (e.g., @vasquez)
4. That subagent dispatches to another subagent(mode:subagent) (e.g., @general)
5. The depth-2 subagent tries to run a bash command (e.g., git status)

Expected Behavior
The permission approval prompt should appear in the TUI, allowing the user 
to approve or reject the command — same as it does for depth-1 subagents.

Actual Behavior
The depth-2 subagent blocks indefinitely. The permission prompt never reaches 
the user. No UI element appears. The session must be interrupted manually.

Workaround
- At depth 1 (primary → subagent → bash), prompts work correctly
- Setting bash commands to "allow" avoids the prompt entirely
- Having the depth-1 orchestrator execute bash directly also works

Environment
- OS: Windows (PowerShell)
- opencode version: 1.18.19
- Model: opencode/big-pickle

### Plugins

superpowers

### OpenCode version

1.18.19

### Steps to reproduce

1. Set subagent_depth: 2 in opencode.json
2. Set permission.bash: { "*": "ask" }
3. From primary agent, dispatch to a subagent(mode=all) (e.g., @vasquez)
4. That subagent dispatches to another subagent(mode:subagent) (e.g., @general)
5. The depth-2 subagent tries to run a bash command (e.g., git status)

### Screenshot and/or share link

_No response_

### Operating System

Windows 11

### Terminal

Windows Terminal

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.