anomalyco / anomalyco/opencode

ACP fresh sessions ignore the default agent variant

Open
#41,628 1 comment 0 reactions 1 assignee View on GitHub

@nexxeln is already working on this.

Since Aug 11, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

Fresh ACP sessions select the first available model variant instead of the default primary agent variant configured in opencode.json, even when the agent model matches the configured default model.

For example:

{
  "model": "openai/gpt-5.4",
  "agent": {
    "build": {
      "model": "openai/gpt-5.4",
      "variant": "high"
    }
  }
}

If the model variants are ordered low, medium, high, a new ACP session reports low as its current effort instead of high. The configured model itself is selected correctly.

The current ACP directory snapshot retains the default model but not the matching default agent variant. Initial variant selection therefore falls through to variants.default or Object.keys(variants)[0].

This appears to be a regression of #21556, which reported the same ACP model/variant behavior and was closed after #25663. Related ACP configuration issues include #4001 and #18620. The broader TUI/Desktop agent-default-variant work is tracked in #7138 and #7156; this report is limited to fresh ACP session initialization.

Plugins

None required.

OpenCode version

Reproduced on current dev at 3a90639 (packages/opencode version 1.18.16).

Steps to reproduce
  1. Configure a default model and matching agent.build.model with agent.build.variant as shown above.
  2. Start a fresh session through an ACP client such as Zed or Emacs agent-shell.
  3. Inspect the initial model and effort configuration.
  4. The model matches the configuration, but effort uses the first model variant instead of agent.build.variant.
Screenshot and/or share link

Not applicable. The behavior is reproducible in the ACP session service test harness.

Operating System

macOS 26.5.1, Apple Silicon.

Terminal

ACP via Emacs agent-shell.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.