anomalyco / anomalyco/opencode

Per-agent model configuration has no effect when using ACP

Open
#46,311 1 comment 0 reactions 1 assignee View on GitHub

@kitlangton is already working on this.

Since Aug 30, 2026.

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

Description

Description

Expected behavior
ACP prompt routing should match CLI behavior in terms of per-agent models taking precedence over the session default.

Actural behavior

  1. The ACP prompt handler always passes the session-level model as input.model to session.prompt(). This short-circuits the fallback chain in prompt.ts, so ag.model is never reached.
  2. loadDirectorySnapshot in service.ts strips agent models when building the mode list, mapping other agent fields but omitting model. Meanwhile the CLI path in directory.ts correctly includes the model spread.
Plugins

None

OpenCode version

1.18.25 (dc4449df0)

Steps to reproduce
  1. Configure per-agent models in opencode.jsonc:
{
  "agent": {
    "plan": { "model": "provider/large-model" },
    "build": { "model": "provider/fast-model" }
  }
}
  1. Connect an ACP client (e.g., Xcode) and create a new session
  2. Switch to the "plan" agent via session/set_mode or session/set_config_option
  3. Send a prompt
  4. Observe the provider logs; the prompt is routed to the session-level default model, not provider/large-model
  5. For comparison, run the same agent via the CLI: opencode run --agent plan "hello", where the CLI correctly routes to provider/large-model
Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

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.