Skip to content

Agent variant in config silently ignored when session model is locked #28803

@ai-era-agent

Description

@ai-era-agent

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

  1. Start opencode, select a model with variant (e.g., deepseek/deepseek-v4-pro with high)
  2. Edit ~/.config/opencode/opencode.json:
    "agent": {
      "build": {
        "model": "deepseek/deepseek-v4-pro",
        "variant": "max"
      }
    }
  3. Restart opencode — variant remains high (from DB), ignoring config

Expected Behavior

  1. Config file variant should take effect, or
  2. UI should warn that session-level model lock overrides config, or
  3. 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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions