Subagent with specific model results in model change in build and plan mode #4082

Open
opened 2026-02-16 17:42:32 -05:00 by yindo · 4 comments
Owner

Originally created by @legout on GitHub (Jan 2, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

When using a subagent with a specific model, it happens, with the current version (1.0.223), that the main models (build and plan) is also changed to the subagents model. This did not happen before. Is this intentional? Can I reset/configure this somehow?

OpenCode version

1.0.223

Steps to reproduce

  1. Start using Model A
  2. Trigger a subanget for which another model (Model B) is set in the config
  3. After the subagent finished, the Model B is also set for the main agents (build and plan)

Screenshot and/or share link

No response

Operating System

Ubuntu 22.04

Terminal

wezterm

Originally created by @legout on GitHub (Jan 2, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description When using a subagent with a specific model, it happens, with the current version (1.0.223), that the main models (build and plan) is also changed to the subagents model. This did not happen before. Is this intentional? Can I reset/configure this somehow? ### OpenCode version 1.0.223 ### Steps to reproduce 1. Start using Model A 2. Trigger a subanget for which another model (Model B) is set in the config 3. After the subagent finished, the Model B is also set for the main agents (build and plan) ### Screenshot and/or share link _No response_ ### Operating System Ubuntu 22.04 ### Terminal wezterm
yindo added the bug label 2026-02-16 17:42:32 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 2, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #4344: Model doesn't stick when switching between agents - similar issue where agent model changes unexpectedly
  • #4475: Plugins/tools causing model to switch to agent default - may be related mechanism
  • #5054: Feature request for environment variable control of models - users seeking better model configuration management

Feel free to ignore if your specific case differs from these.

@github-actions[bot] commented on GitHub (Jan 2, 2026): This issue might be a duplicate of existing issues. Please check: - #4344: Model doesn't stick when switching between agents - similar issue where agent model changes unexpectedly - #4475: Plugins/tools causing model to switch to agent default - may be related mechanism - #5054: Feature request for environment variable control of models - users seeking better model configuration management Feel free to ignore if your specific case differs from these.
Author
Owner

@OscSer commented on GitHub (Jan 8, 2026):

This has also been happening to me with custom commands that use a different model than the main agent, even if the command is configured as a subtask or subagent.

@OscSer commented on GitHub (Jan 8, 2026): This has also been happening to me with custom commands that use a different model than the main agent, even if the command is configured as a subtask or subagent.
Author
Owner

@rekram1-node commented on GitHub (Jan 8, 2026):

ill fix

@rekram1-node commented on GitHub (Jan 8, 2026): ill fix
Author
Owner

@iamhenry commented on GitHub (Jan 11, 2026):

i have the same issue
my commit slash command = grok model
opus configured to be default for build agent

when i run the commit slash command with subtask: true it uses the build opus model

@iamhenry commented on GitHub (Jan 11, 2026): i have the same issue my commit slash command = grok model opus configured to be default for build agent when i run the commit slash command with `subtask: true` it uses the build opus model
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4082