Description
When a primary agent running a non-default model (e.g. selected interactively or different from opencode.json) spawns a subagent via the Task tool, the subagent ignores the parent's active session model and falls back to the global "model" defined in opencode.json.
The docs state:
"If you don't specify a model, subagents will use the model of the primary agent that invoked the subagent."
This does not happen in practice when the session model differs from the global config.
Expected behavior: Subagent inherits the active model of the parent session that invoked it.
Actual behavior: Subagent uses the global config default (opencode.json "model" field), ignoring the parent's active session model.
Related issues:
Plugins
No response
OpenCode version
v1.2.27
Steps to reproduce
- Set
"model": "azure/gpt-4o" in opencode.json (global default)
-
- Start an opencode session and switch to
anthropic/claude-sonnet-4-6 interactively via the model picker
-
- Primary agent (running claude-sonnet-4-6) invokes a subagent via the Task tool — no explicit
model param passed
-
- Observe: subagent runs on
azure/gpt-4o (global default) instead of anthropic/claude-sonnet-4-6 (parent's active model)
Screenshot and/or share link
No response
Operating System
Linux (Ubuntu 24.04)
Terminal
opencode TUI
Description
When a primary agent running a non-default model (e.g. selected interactively or different from
opencode.json) spawns a subagent via the Task tool, the subagent ignores the parent's active session model and falls back to the global"model"defined inopencode.json.The docs state:
This does not happen in practice when the session model differs from the global config.
Expected behavior: Subagent inherits the active model of the parent session that invoked it.
Actual behavior: Subagent uses the global config default (
opencode.json"model"field), ignoring the parent's active session model.Related issues:
modelparam to Task tool (workaround, not a fix for auto-inheritance)Plugins
No response
OpenCode version
v1.2.27
Steps to reproduce
"model": "azure/gpt-4o"inopencode.json(global default)anthropic/claude-sonnet-4-6interactively via the model pickermodelparam passedazure/gpt-4o(global default) instead ofanthropic/claude-sonnet-4-6(parent's active model)Screenshot and/or share link
No response
Operating System
Linux (Ubuntu 24.04)
Terminal
opencode TUI