Non deterministic behaviour of variants passed into agents in the opencode.json config

Description

Even when passing in variants to agents, these don not still get used, switching to another variant makes that the new default and ignores what has been set in the config.

I tested using this config

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {

  },
  "agent": {
    "build": {
      "model": "opencode/gpt-5.1-codex",
      "variant": "medium"
    },
    "plan": {
      "model": "opencode/gpt-5.3-codex",
      "variant": "high"
    }
  }
}

Video below

Plugins

None

OpenCode version

1.2.17

Steps to reproduce

  1. Use the config provided
  2. Try to update the variant of the build agent, and make request
  3. Cycle round back to the build agent, notice the last variant is used rather than what is set in the config, same thing happens if you close the TUI and open again.

Screenshot and/or share link

Screen.Recording.2026-03-04.at.19.01.00.mov

Operating System

macOS

Terminal

Ghostty