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
Background subagent result resets the main session model #28735
When a background subagent finishes and its result is delivered back into the current main session, the active model in the main session appears to be reset to the agent/default model.
This is not just a case where I changed the selector but had not sent anything yet. I switch the main session model first, for example from a GLM model to a GPT model, then send at least one normal main-session message with that new model. Later, while work is ongoing, an async/background subagent result returns and the main session is switched back to the previous/default model.
This feels related to older model-state issues such as #6636 and #21728, but the important detail here is that the newly selected model had already been used for a main-session message before the async subagent result arrived.
Plugins
No plugin is required for this behavior. The issue appears on the native background subagent/session model path; plugins do not appear to affect the repro.
OpenCode version
1.15.6
Steps to reproduce
Start a session with the default model set to model A, for example GLM.
Launch a background subagent/task that will return later.
Switch the main session to model B, for example GPT.
Send at least one normal main-session message using model B.
While work continues, wait for the background subagent result to be delivered back into the main session.
Observe that the main session model is switched back to model A/default.
Expected: once the main session has sent a message with model B, an async subagent result should not overwrite the active main-session model back to model A/default.
Thanks, I checked #21728 and #21351. This looks related, but I don't think it is the same repro.
I'm using the experimental native background subagents path (task(background=true) / task_status), not a direct POST /session/:id/prompt_async notification and not a Plan/Build mode switch.
The main session had already switched to the new model and sent a normal message with it. Later, when the background subagent result was injected back into the main session, the main session model reset to the default.
Activity
github-actions commentedon May 21, 2026
This issue might be a duplicate of existing issues. Please check:
If your issue is distinct from these, feel free to clarify the differences.
wanyaoluo commentedon May 21, 2026
Thanks, I checked #21728 and #21351. This looks related, but I don't think it is the same repro.
I'm using the experimental native background subagents path (
task(background=true)/task_status), not a directPOST /session/:id/prompt_asyncnotification and not a Plan/Build mode switch.The main session had already switched to the new model and sent a normal message with it. Later, when the background subagent result was injected back into the main session, the main session model reset to the default.
github-actions commentedon Jul 21, 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.