anomalyco / anomalyco/opencode
Per-agent model configuration has no effect when using ACP
Open
@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
- The ACP prompt handler always passes the session-level model as
input.modeltosession.prompt(). This short-circuits the fallback chain inprompt.ts, soag.modelis never reached. loadDirectorySnapshotinservice.tsstrips agent models when building the mode list, mapping other agent fields but omittingmodel. Meanwhile the CLI path indirectory.tscorrectly includes the model spread.
Plugins
None
OpenCode version
1.18.25 (dc4449df0)
Steps to reproduce
- Configure per-agent models in
opencode.jsonc:
{
"agent": {
"plan": { "model": "provider/large-model" },
"build": { "model": "provider/fast-model" }
}
}
- Connect an ACP client (e.g., Xcode) and create a new session
- Switch to the "plan" agent via
session/set_modeorsession/set_config_option - Send a prompt
- Observe the provider logs; the prompt is routed to the session-level default model, not
provider/large-model - For comparison, run the same agent via the CLI:
opencode run --agent plan "hello", where the CLI correctly routes toprovider/large-model
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.