Repository navigation
[Bug]: Native chat rejects every message when the selected model differs from the agent's current model — OpenCode 2 ACP has no session/set_model (root cause + verified fallback) #32183
Description
Operating system
macOS
Orca version
1.4.237
Details
Summary
In the Chat UI, any conversation whose selected model differs from the OpenCode agent's current model rejects every message immediately with OpenCode didn't accept this message. (rejection.kind = providerRejected). The default model works fine in the same setup. The prompt never reaches the agent or the model provider.
This is the same visible failure as #31475 and #31423, but with the actual root cause identified and a verified fix path.
Root cause
Orca writes the model option via the custom ACP method session/set_model (src/main/acp/acp-session-runtime.ts:224 on current main). The OpenCode v2 line does not implement that method — it returns JSON-RPC -32601 "Method not found": session/set_model. applyAcpMessageOptions (src/main/acp/acp-message-execution-options.ts:38-52) converts any setOption failure into AgentSessionOptionRejectedError, so the message is rejected before session/prompt is ever sent.
session/set_model exists in the OpenCode 1.x ACP implementation (cf. anomalyco/opencode#9941), but the v2 rewrite (latest release v2.1.3) ships session/set_mode and session/set_config_option instead. Verified against both 2.1.2 and 2.1.3 binaries.
Why the default model works: the skip condition at acp-message-execution-options.ts:35 (reported()[key] === value) bypasses the write when the selected model already equals the agent's current model.
Reproduction
- opencode 2.1.2 (homebrew) with a config default model
Aand at least one other modelB(any custom provider; I used self-hosted models behind an OpenAI-compatible gateway). - Open a Chat UI conversation with the OpenCode agent on model
A(the config default) → works. - New conversation with model
B→ every message is rejected within ~25 ms withOpenCode didn't accept this message.
Evidence
agent-session-journal.db: 5 sessions on modelB, all 8 dispatchespending → rejectedin ~24 ms, reasonThe agent didn't accept this message.,rejection.kind = providerRejected; zerosession/promptreached the agent (provider-side logs show no requests).- Raw ACP test against
opencode acp(2.1.2 and 2.1.3):initialize→session/new→session/set_model {sessionId, modelId: "B"}returns-32601 "Method not found": session/set_model. The same flow with the default model never needs the call and works. stringson both binaries:session/set_mode,session/set_config_optionpresent;session/set_modelabsent.opencode run -m B(CLI) and the HTTP API both work — the model itself is healthy.
Verified fix path
OpenCode 2.x does implement model switching via session/set_config_option:
--> session/set_config_option {"configId": "model", "value": "<provider>/<model>"}
<== ok (session/new's configOptions then reports currentValue = <provider>/<model>)
--> session/prompt {"prompt": "reply with exactly: ok"}
<== "ok" (usage_update reports the selected model's context window)
Verified against 2.1.2: the switch happens and the prompt runs on the selected model.
Suggested fix
In the ACP model-write path, fall back to session/set_config_option {configId: "model", value} when session/set_model fails with -32601 (Method not found) — or, more generally, prefer the agent's advertised configOptions from session/new when it offers a model config option. The current Pi/OMP fixes (#31863, #31998) address effort-restore rejections but not this path; on main today session/set_model is still called unconditionally (acp-session-runtime.ts:224) and the opencode dialect does not override model writes.
Workarounds
- Set the desired model as the config default in
opencode.jsonc(modelfield) — Orca skips the write when selected == current. (Flips the failure onto the other models, so only useful when one model dominates.) - Use the opencode CLI/TUI for non-default models.
Related
- [Bug]: Chat UI: prompts rejected immediately ("OpenCode 2 didn't accept this message") when the selected model is a GitHub Copilot model #31475 — same mechanism (GitHub Copilot models), root cause not identified there
- agent-session: first prompt rejected as providerRejected in new OpenCode session (ACP handle still "pending") #31423 — same visible symptom; thread converges on a different variant (leaked provider supervisors)
- [Bug]: OMP native chat rejects every message when the saved model differs from OMP's default and no effort is saved #31995 / [Bug]: Pi native chat rejects every message when Orca's Pi model preference has no effort for it #31849 — same "model-only message rejected" family for OMP/Pi (effort-restore cause), fix PRs fix(acp): treat other models' effort menus as unknown so new chats can seed an effort #31998 / fix(pi): keep model-only messages deliverable #31863
Activity
yzyDavid commentedon Oct 23, 2026
Correction: the operative root cause for the OpenCode 2 case is the effort-admission guard fixed by #32004, not
session/set_modelFollow-up verification on my setup narrows this down, and my original analysis was wrong about the trigger:
AcpStructuredOptions.write()(acp-structured-options.ts:127-134) prefers the agent-declaredmodelconfig option oversession/set_model. OpenCode 2 declaresid: "model"(categorymodel), so the model switch goes throughsession/set_config_optionand succeeds —session/set_modelis never called for OpenCode 2.applyAcpMessageOptions: a message with noeffort, on a model whose listing has no efforts/default effort, is refused whenever the agent reports one. Verified on my setup: after switching to the non-default model, OpenCode 2 reports aneffortconfigOption (categorythought_level, current"default"), so the oldsession.options.reported()['effort'] !== undefinedcondition fires →AgentSessionOptionRejectedError→ "OpenCode didn't accept this message." Messages that carry an effort value (my default-model sessions) are unaffected — which is why the default model kept working.So for anyone on ≤ 1.4.237 seeing this with OpenCode 2: the fix is #32004, pending the next release.
The
session/set_modelgap described in the issue body is real but latent for OpenCode 2 (it would only matter for an ACP agent that exposes a models list but nomodelconfig option — on such an agent Orca would callsession/set_modeland OpenCode 2 would answer-32601). Happy to split that into its own lower-priority issue, or this can be closed as covered by #32004.nwparker commentedon Oct 24, 2026
Thanks for the detailed report, @yzyDavid. Chats failing with a model-only change (no known default effort for the selected model) were fixed in #32004 (shipped in v1.4.239): the guard now only refuses when Orca has already applied a value that differs from the agent's initial one, for both ACP and Pi RPC chats. Could you try the latest build? If it still happens, please reply or reopen with the details.