Description
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:
{
"agents": {
"subagent-name": {
"model": "faster-cheaper-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.
Screenshot and/or share link
No response
Operating System
Windows 11
Terminal
Windows Terminal
Description
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: subagentsetting defined in the original agent.mdfiles 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
mode: subagentin its.mddefinition.opencode.jsonto override its model:{ "agents": { "subagent-name": { "model": "faster-cheaper-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.
Screenshot and/or share link
No response
Operating System
Windows 11
Terminal
Windows Terminal