You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Subagents listed in opencode.json are incorrectly treated as primary agents (ignoring mode: subagent from agent files) #22130
When any subagent is added to opencode.json (even just to override the model for cost/performance reasons), OpenCode treats it as a primary agent.
The mode: subagent setting defined in the original agent .md files is completely ignored.
This causes all configured subagents to appear in the footer/Tab agent selector (making it unusable when using plugins like Compound Engineering that register many agents).
Plugins
No response
OpenCode version
1.3.17 (and all versions since v1.3.4)
Steps to reproduce
Use any subagent (e.g. from Compound Engineering) that has mode: subagent in its .md definition.
Add an entry for that agent in opencode.json to override its model:
Restart OpenCode or reload the session.
Press Tab in the footer or look at the agent selector.
Expected behavior
The subagent should remain a subagent (hidden from the footer/Tab selector) because its canonical definition in the .md file specifies mode: subagent. Config overrides should only affect model/settings, not the agent mode.
Actual behavior
All agents present in opencode.json are forcibly treated as primary agents. The footer/Tab selector now shows many entries instead of only the true primary agents.
Workaround (confirmed working)
Remove the agent entry from opencode.json, or
Explicitly add "mode": "subagent" inside the config entry.
changed the title [-]Bug: Subagents listed in `opencode.json` are incorrectly treated as primary agents (ignoring `mode: subagent` from agent files)[/-][+][Bug]: Subagents listed in `opencode.json` are incorrectly treated as primary agents (ignoring `mode: subagent` from agent files)[/+]on Apr 12, 2026
This issue might be a duplicate of existing issues. Please check:
[FEATURE]: Footer/Tab agent selector should show only primary agents (or be configurable) #21364: Same root cause and symptoms — subagents appearing in the footer/Tab agent selector since v1.3.4. That issue (also filed by you) was closed; this bug report frames it as the mode: subagent setting being ignored when an agent is also listed in opencode.json, which is a related but more specific angle.
If the underlying bug (config overrides dropping the mode from the .md definition) is distinct from #21364, please clarify in this issue so maintainers can track them separately.
I also encountered this on OC 1.4.1. If I set the mode in the .md to primary and don't explicitly configure it in opencode.json, it is still listed as both a primary and a subagent. Effectively, the option seems to be getting ignored.
I also encountered this on OC 1.4.1. If I set the mode in the .md to primary and don't explicitly configure it in opencode.json, it is still listed as both a primary and a subagent. Effectively, the option seems to be getting ignored.
OpenCode version
v1.4.1
Operating System
Arch Linux
Terminal
WezTerm
me too, also ignore the model that i wrote in ~/.config/opencode/agents/xx.md
Activity
[-]Bug: Subagents listed in `opencode.json` are incorrectly treated as primary agents (ignoring `mode: subagent` from agent files)[/-][+][Bug]: Subagents listed in `opencode.json` are incorrectly treated as primary agents (ignoring `mode: subagent` from agent files)[/+]github-actions commentedon Apr 12, 2026
This issue might be a duplicate of existing issues. Please check:
mode: subagentsetting being ignored when an agent is also listed inopencode.json, which is a related but more specific angle.If the underlying bug (config overrides dropping the
modefrom the.mddefinition) is distinct from #21364, please clarify in this issue so maintainers can track them separately.AMythicDev commentedon Apr 12, 2026
I also encountered this on OC 1.4.1. If I set the
modein the.mdtoprimaryand don't explicitly configure it inopencode.json, it is still listed as both a primary and a subagent. Effectively, the option seems to be getting ignored.OpenCode version
v1.4.1
Operating System
Arch Linux
Terminal
WezTerm
PassionPI commentedon Apr 15, 2026
me too, also ignore the
modelthat i wrote in~/.config/opencode/agents/xx.mdgithub-actions commentedon Jul 4, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.