anomalyco / anomalyco/opencode
Manually selected model reverts to the agent's configured model after every turn
@rekram1-node is already working on this.
Since Jul 28, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
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:
Promptrestores the model from the last user message on session hydration, overwriting the pick. - Desktop: the agent
Selectcallsagents.select(...)even when the value is unchanged, andagent.setalways rewrites the model asitem.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 thebuildagent's model, e.g."agent": { "build": { "model": "provider/model-a" } } - Start a session with
buildand 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
Operating System
macOS 26.5.2
Terminal
Ghostty (also reproduced in the desktop app)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.