Summary
The Agents documentation says hidden applies only to subagents. The TUI applies
it to every mode, and the built-in agents rely on that.
What the docs say
From https://opencode.ai/docs/agents/ under 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.
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.
What the code does
The Tab-cycle list is built at packages/tui/src/context/local.tsx:77:
const agents = createMemo(() => sync.data.agent.filter((agent) => agent.mode !== "subagent" && !agent.hidden))
The !agent.hidden clause is evaluated for every mode. It is also the only
mechanism excluding the built-in system agents from the cycle: compaction,
title, and summary are each declared mode: "primary" with hidden: true
at packages/opencode/src/agent/agent.ts:221-259, and the docs describe them as
"not selectable in the UI".
So hidden on a primary or all agent is both supported and load-bearing,
while the documentation states it has no effect.
Verified behavior on 1.18.22
A markdown agent declared mode: all with hidden: true:
- survives configuration resolution, reported by
opencode debug config as
{"mode": "all", "hidden": true}
- is still resolved by
opencode run --agent <name>, with no fallback warning
and the correct executor in the output header
Why it matters
An agent dispatched programmatically through opencode run --agent must be
primary-capable, because run mode refuses mode: subagent:
! agent "probe-sub" is a subagent, not a primary agent. Falling back to default agent
A project shipping several such agents therefore pushes all of them into the
user's Tab cycle. hidden: true solves this cleanly, but the documentation's
note says it will not work, so the option is not reached.
Suggested change
In the Hidden section, replace the subagent-only note with the actual scope:
hidden removes a subagent from @ autocomplete, and removes any agent from the
primary-agent Tab cycle, and does not affect opencode run --agent resolution or
Task-tool invocation. A sentence noting that the built-in system agents use this
mechanism would make the intent clear.
Summary
The Agents documentation says
hiddenapplies only to subagents. The TUI appliesit to every mode, and the built-in agents rely on that.
What the docs say
From https://opencode.ai/docs/agents/ under Hidden:
What the code does
The Tab-cycle list is built at
packages/tui/src/context/local.tsx:77:The
!agent.hiddenclause is evaluated for every mode. It is also the onlymechanism excluding the built-in system agents from the cycle:
compaction,title, andsummaryare each declaredmode: "primary"withhidden: trueat
packages/opencode/src/agent/agent.ts:221-259, and the docs describe them as"not selectable in the UI".
So
hiddenon aprimaryorallagent is both supported and load-bearing,while the documentation states it has no effect.
Verified behavior on 1.18.22
A markdown agent declared
mode: allwithhidden: true:opencode debug configas{"mode": "all", "hidden": true}opencode run --agent <name>, with no fallback warningand the correct executor in the output header
Why it matters
An agent dispatched programmatically through
opencode run --agentmust beprimary-capable, because run mode refuses
mode: subagent:A project shipping several such agents therefore pushes all of them into the
user's Tab cycle.
hidden: truesolves this cleanly, but the documentation'snote says it will not work, so the option is not reached.
Suggested change
In the Hidden section, replace the subagent-only note with the actual scope:
hiddenremoves a subagent from@autocomplete, and removes any agent from theprimary-agent Tab cycle, and does not affect
opencode run --agentresolution orTask-tool invocation. A sentence noting that the built-in system agents use this
mechanism would make the intent clear.