Description
When a model/variant is selected during initial setup, opencode stores it in the session SQLite database (~/.local/share/opencode/opencode.db) as:
{"id":"deepseek-v4-pro","providerID":"deepseek","variant":"high"}
After this, changing variant in opencode.json agent config has no effect — the session DB value silently overrides the config file.
Steps to Reproduce
- Start opencode, select a model with variant (e.g.,
deepseek/deepseek-v4-pro with high)
- Edit
~/.config/opencode/opencode.json:
"agent": {
"build": {
"model": "deepseek/deepseek-v4-pro",
"variant": "max"
}
}
- Restart opencode — variant remains
high (from DB), ignoring config
Expected Behavior
- Config file
variant should take effect, or
- UI should warn that session-level model lock overrides config, or
- Provide a way to trigger model/variant re-selection (e.g.,
/model command or settings UI)
Workaround
Manually update the session record in opencode.db:
UPDATE session SET model = {"id": "deepseek-v4-pro", "providerID": "deepseek", "variant": "max"} WHERE id = <session_id>;
Related
Description
When a model/variant is selected during initial setup, opencode stores it in the session SQLite database (
~/.local/share/opencode/opencode.db) as:{"id":"deepseek-v4-pro","providerID":"deepseek","variant":"high"}After this, changing
variantinopencode.jsonagent config has no effect — the session DB value silently overrides the config file.Steps to Reproduce
deepseek/deepseek-v4-prowithhigh)~/.config/opencode/opencode.json:high(from DB), ignoring configExpected Behavior
variantshould take effect, or/modelcommand or settings UI)Workaround
Manually update the session record in
opencode.db:Related