From fd7b7eacd3c2da70021ec3ed4905d072abd20b56 Mon Sep 17 00:00:00 2001 From: "Sewer." Date: Wed, 7 Jan 2026 04:29:17 +0000 Subject: Added: Ability to hide subagents from primary agents system prompt. (#4773) Co-authored-by: GitHub Action Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Co-authored-by: Aiden Cline --- packages/web/src/content/docs/agents.mdx | 56 ++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) (limited to 'packages/web/src/content/docs') diff --git a/packages/web/src/content/docs/agents.mdx b/packages/web/src/content/docs/agents.mdx index f3f0b52eb..3dfd16e7d 100644 --- a/packages/web/src/content/docs/agents.mdx +++ b/packages/web/src/content/docs/agents.mdx @@ -510,6 +510,62 @@ The `mode` option can be set to `primary`, `subagent`, or `all`. If no `mode` is --- +### Hidden + +Hide a subagent from the `@` autocomplete menu with `hidden: true`. Useful for internal subagents that should only be invoked programmatically by other agents via the Task tool. + +```json title="opencode.json" +{ + "agent": { + "internal-helper": { + "mode": "subagent", + "hidden": true + } + } +} +``` + +This only affects user visibility in the autocomplete menu. Hidden agents can still be invoked by the model via the Task tool if permissions allow. + +:::note +Only applies to `mode: subagent` agents. +::: + +--- + +### Task permissions + +Control which subagents an agent can invoke via the Task tool with `permission.task`. Uses glob patterns for flexible matching. + +```json title="opencode.json" +{ + "agent": { + "orchestrator": { + "mode": "primary", + "permission": { + "task": { + "*": "deny", + "orchestrator-*": "allow", + "code-reviewer": "ask" + } + } + } + } +} +``` + +When set to `deny`, the subagent is removed from the Task tool description entirely, so the model won't attempt to invoke it. + +:::tip +Rules are evaluated in order, and the **last matching rule wins**. In the example above, `orchestrator-planner` matches both `*` (deny) and `orchestrator-*` (allow), but since `orchestrator-*` comes after `*`, the result is `allow`. +::: + +:::tip +Users can always invoke any subagent directly via the `@` autocomplete menu, even if the agent's task permissions would deny it. +::: + +--- + ### Additional Any other options you specify in your agent configuration will be **passed through directly** to the provider as model options. This allows you to use provider-specific features and parameters. -- cgit v1.2.3