Subagent doesn't ask permission when executing bash commands #2683

Closed
opened 2026-02-16 17:36:50 -05:00 by yindo · 2 comments
Owner

Originally created by @nithin-raj-9100 on GitHub (Nov 8, 2025).

Description

When the main agent delegates a task to sub agent and this subagent tries to run bash commands it doesn't run probably waiting for my permission with the delegated session

Here is my opencode.json

{
  "$schema": "https://opencode.ai/config.json",
  "permission": {
    "edit": "ask",
    "bash":{
      "fd": "allow",
      "rg": "allow",
      "*": "ask"
    }
  }
}

OpenCode version

1.0.45

Steps to reproduce

  1. Delegate a subagent such that it needs to execute bash commands
  2. Wait until it tries to run bash commands
  3. Bash command will never run and doesn't return at all and doesn't proceed with next steps gets struck there itself

Screenshot and/or share link

I can't share via /share but here is the relevant screenshots

Image

Operating System

macOS 26.1

Terminal

Ghostty 1.2.3 Version - version: 1.2.3 - channel: stable Build Config - Zig version : 0.14.1 - build mode : builtin.OptimizeMode.ReleaseFast - app runtime : apprt.Runtime.none - font engine : font.main.Backend.coretext - renderer : renderer.generic.Renderer(renderer.Metal) - libxev : kqueue

Originally created by @nithin-raj-9100 on GitHub (Nov 8, 2025). ### Description When the main agent delegates a task to sub agent and this subagent tries to run bash commands it doesn't run probably waiting for my permission with the delegated session Here is my opencode.json ``` { "$schema": "https://opencode.ai/config.json", "permission": { "edit": "ask", "bash":{ "fd": "allow", "rg": "allow", "*": "ask" } } } ``` ### OpenCode version 1.0.45 ### Steps to reproduce 1. Delegate a subagent such that it needs to execute bash commands 2. Wait until it tries to run bash commands 3. Bash command will never run and doesn't return at all and doesn't proceed with next steps gets struck there itself ### Screenshot and/or share link I can't share via /share but here is the relevant screenshots <img width="1468" height="679" alt="Image" src="https://github.com/user-attachments/assets/ef727a34-b909-4886-8f67-61299d2b5395" /> ### Operating System macOS 26.1 ### Terminal Ghostty 1.2.3 Version - version: 1.2.3 - channel: stable Build Config - Zig version : 0.14.1 - build mode : builtin.OptimizeMode.ReleaseFast - app runtime : apprt.Runtime.none - font engine : font.main.Backend.coretext - renderer : renderer.generic.Renderer(renderer.Metal) - libxev : kqueue
yindo added the opentuibug labels 2026-02-16 17:36:50 -05:00
yindo closed this issue 2026-02-16 17:36:50 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 8, 2025):

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

  • #3503: Reports the same problem with bash permissions hanging when set to "ask", though in opencode run mode
  • #3808: Discusses how subagents don't inherit parent agent permissions and can bypass restrictions

The core issue appears to be that permission requests for bash commands are not properly handled in delegated contexts (subagents in your case, opencode run mode in #3503).

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Nov 8, 2025): This issue might be a duplicate of existing issues. Please check: - #3503: Reports the same problem with bash permissions hanging when set to "ask", though in `opencode run` mode - #3808: Discusses how subagents don't inherit parent agent permissions and can bypass restrictions The core issue appears to be that permission requests for bash commands are not properly handled in delegated contexts (subagents in your case, `opencode run` mode in #3503). Feel free to ignore if none of these address your specific case.
Author
Owner

@nithin-raj-9100 commented on GitHub (Nov 8, 2025):

Closing because of duplicate issue

@nithin-raj-9100 commented on GitHub (Nov 8, 2025): Closing because of duplicate issue
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2683