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.model to session.prompt(). This short-circuits the fallback chain in prompt.ts, so ag.model is never reached.
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 (dc4449d)
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_mode or session/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 to provider/large-model
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
Description
Expected behavior
ACP prompt routing should match CLI behavior in terms of per-agent models taking precedence over the session default.
Actural behavior
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 (dc4449d)
Steps to reproduce
opencode.jsonc:{ "agent": { "plan": { "model": "provider/large-model" }, "build": { "model": "provider/fast-model" } } }session/set_modeorsession/set_config_optionprovider/large-modelopencode run --agent plan "hello", where the CLI correctly routes toprovider/large-modelScreenshot and/or share link
No response
Operating System
No response
Terminal
No response