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
[FEATURE]:Possibility for choosing the model for the subagents #46122
I've hit this exact need with a multi-model agent cluster. Some empirical findings that might help:
Runtime config changes don't take effect: modifying agents/*.md model frontmatter while opencode is running does not affect new subagent sessions (verified via the session table's model field) — config is loaded at startup.
The plumbing already exists: in packages/opencode/src/tool/task.ts the model resolution chain (agent model first, falling back to the parent message model) is already there, and the underlying PromptInput already accepts an optional model — only the task tool's Parameters schema is missing an optional model field. A minimal patch is ~15 lines.
Use case: cost-tiered agents — a cheap flash worker by default, with per-task override to a stronger reasoning model for critical paths, without duplicating agent definitions per model tier.
I'd be happy to open a PR for the minimal patch if maintainers are interested in this direction.
Thanks for the suggestion — OpenCode 2.0.5 added the ability to choose a model for individual subagent tasks, including codebase exploration. Ask OpenCode to use a particular model for the subagent, or set a default with "agents": { "explore": { "model": "provider/model" } } in your opencode.json, replacing provider/model with a model from one of your providers. Update with opencode upgrade or npm i -g @opencode/cli@latest (desktop: update the app). Please reopen or comment if this still doesn't work on that version.
Activity
github-actions commentedon Aug 29, 2026
This issue might be a duplicate of existing issues. Please check:
CloudyRiver9 commentedon Sep 1, 2026
I've hit this exact need with a multi-model agent cluster. Some empirical findings that might help:
agents/*.mdmodel frontmatter while opencode is running does not affect new subagent sessions (verified via the session table'smodelfield) — config is loaded at startup.packages/opencode/src/tool/task.tsthe model resolution chain (agent model first, falling back to the parent message model) is already there, and the underlyingPromptInputalready accepts an optionalmodel— only the task tool'sParametersschema is missing an optionalmodelfield. A minimal patch is ~15 lines.I'd be happy to open a PR for the minimal patch if maintainers are interested in this direction.
neriousy commentedon Oct 20, 2026
Thanks for the suggestion — OpenCode 2.0.5 added the ability to choose a model for individual subagent tasks, including codebase exploration. Ask OpenCode to use a particular model for the subagent, or set a default with
"agents": { "explore": { "model": "provider/model" } }in youropencode.json, replacingprovider/modelwith a model from one of your providers. Update withopencode upgradeornpm i -g @opencode/cli@latest(desktop: update the app). Please reopen or comment if this still doesn't work on that version.