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
Manually selected model reverts to the agent's configured model after every turn #39319
A manually selected model reverts to the agent's configured model after every conversational turn, so it is impossible to stay on a non-default model.
My build agent is pinned to claude-opus-5 in opencode.json. If I pick a different model in the picker, the prompt runs on it, then the picker immediately shows the agent's model again. Next turn runs on the agent's model.
Happens in both the TUI and the desktop app, but for different reasons:
TUI: Prompt restores the model from the last user message on session hydration, overwriting the pick.
Desktop: the agent Select calls agents.select(...) even when the value is unchanged, and agent.set always rewrites the model as item.model ?? prev?.model. Since the agent has a configured model, that always wins.
Possibly related, but different triggers: #38770 (background subagent notifications), #34207 (answering a question). Mine needs no subagents, no questions, and no mid-stream switching.
Plugins
None
OpenCode version
Desktop app 1.18.7, CLI 1.18.4
Steps to reproduce
In opencode.json, set the build agent's model, e.g. "agent": { "build": { "model": "provider/model-a" } }
Start a session with build and confirm it shows model A
Pick a different model B in the picker
Send a prompt and wait for the reply
The picker shows model A again; the next prompt runs on A
Your report is well-detailed and the root-cause analysis (TUI hydration path + desktop agent.set always preferring the configured model) is specific enough that it may be a distinct manifestation. If maintainers confirm it is new, no action needed on your end.
Activity
github-actions commentedon Jul 28, 2026
This issue might be a duplicate of existing issues. Please check:
Your report is well-detailed and the root-cause analysis (TUI hydration path + desktop
agent.setalways preferring the configured model) is specific enough that it may be a distinct manifestation. If maintainers confirm it is new, no action needed on your end.fix(tui,app): keep manually selected model across turns
github-actions commentedon Oct 9, 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.