opencode icon indicating copy to clipboard operation
opencode copied to clipboard

[FEATURE]: Allow showing/hiding subagents from primary agents

Open Sewer56 opened this issue 1 month ago • 8 comments

Feature hasn't been suggested before.

  • [x] I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

The docs show you can show/hide tools from primary agents using the tools config:

{
  "agent": {
    "plan": {
      "tools": {
        "write": false,
        "bash": false
      }
    }
  }
}

It would be useful to have similar control over which subagents a primary agent can invoke.

Proposed Solution

Add a subagents config option to control subagent visibility per primary agent:

{
  "agent": {
    "build": {
      "subagents": {
        "general": true,
        "code-reviewer": false
      }
    }
  }
}

Use Case

I have certain primary agents with varying presets, e.g.

  • orchestrator
  • orchestrator-slow
  • orchestrator-fast

These primary agents follow a loop, which calls underlying subagents. These subagents are specific to their orchestrator modes, and should not be invoked anywhere else.

However, by default, all subagents are available to all modes. This has resulted in some cases of:

  • An orchestrator mode calling the wrong subagent (rare)
  • Regular build/plan agents calling the subagents made for orchestrator (e.g. when being asked to make a code edit).

A filter would prevent this from happening.

Sewer56 avatar Nov 26 '25 03:11 Sewer56