Repository navigation
Description
Environment
- Orca 1.4.237 (Linux AppImage, Ubuntu/Wayland)
- pi (
@earendil-works/pi-coding-agent) 1.4.0 - Agent:
pi(JSONL-RPC structured chat), Linux
Summary
In a new pi chat, every send is rejected with the generic "Pi didn't accept this message." whenever the model selected in the composer differs from the model pi reported at startup (get_state). The rejection is deterministic (retries fail identically) and happens before anything is written to pi — pi never creates a session transcript, and there is no prompt on the RPC pipe.
This is distinct from #31423: that one is the ACP providerHandle: "pending" race, where a retry usually succeeds.
Repro
- Make pi's startup model differ from the model selected in the Orca composer, e.g. pi reports
opencode-go/deepseek-v4.1-flashwhile the composer pinsopencode-go/beam-free(this happens after changing pi's default model/provider insettings.json, or when Orca restores a last-used model). - Open a new
pichat and send any message. - Observe: immediate rejection, no session file created under
~/.pi/agent/sessions/<cwd-slug>/, nothing sent to the agent.
Sends that carry no model (composer left at default) or that match pi's startup model are accepted, so the failure depends only on the mismatch, not on provider identity.
Evidence
Session journal (agent-session-journal.db) for the failing chat:
| time | record | detail |
|---|---|---|
| 10:22:19.020 | epoch session_created |
handle pending |
| 10:22:22.021 | submission |
options: {"model": "opencode-go/beam-free"} |
| 10:22:22.607 | agentSession.startup |
outcome=ready, spawn_to_outcome_ms=302, startup model opencode-go/deepseek-v4.1-flash |
| 10:22:22.609 | dispatch |
state=pending |
| 10:22:22.616 | dispatch |
state=rejected, rejection.kind=providerRejected (7 ms later) |
Driving the same pi binary by hand with the same cwd / PI_CODING_AGENT_DIR / --mode rpc, both calls succeed, so the wire protocol is fine on pi's side:
>> {"type":"set_model","provider":"opencode-go","modelId":"beam-free"}
<< {"success":true,"data":{"id":"beam-free",...}}
>> {"type":"prompt","message":"testing","images":[],"streamingBehavior":"followUp"}
<< {"success":true,"data":{"disposition":"started"}}
Cause (pi adapter, LQ / SQ)
Before writing a prompt, the adapter applies pending options:
let a = t.executionOptions?.model ?? e.initialOptions.model;
if (!t.executionOptions) return e.submit(...);
for (let n of [`model`, `effort`]) {
let r = t.executionOptions?.[n]
?? (n === `model` || a === e.initialOptions.model ? e.initialOptions[n] : undefined);
if (r === undefined && e.optionProof.writes.has(n))
throw new q(Error(`The default ${n} for this model is unknown`)); // thrown here
...
}and SQ records a pending effort write whenever a model write happens, without clearing it afterwards:
if (a?.writes.set(n, c), a?.current.delete(n),
n === `model` && (a?.writes.set(`effort`, c), a?.current.delete(`effort`)))
...
await w.r(e.request(o, s, {timeoutMs: i.timeoutMs}), i.signal);
return t.set(n, r), a?.current.set(n, r), Object.fromEntries(t); // writes never clearedSo with a model mismatch: (1) the model write runs and sets writes = {model, effort}; (2) the send carries no effort, and the initialOptions.effort fallback only applies when a === initialOptions.model, which is false; (3) writes.has('effort') is true → throw → dispatch recorded as providerRejected → UI renders the generic rejection string.
writes is never reset for the life of the session, so every subsequent send with the same pinned model fails the same way.
Suggested fix
Resolve the effort for the newly selected model instead of throwing — e.g. use the per-model defaultEffort / thinkingLevelMap already returned by get_available_models (the adapter fetches it in xQ), or clear optionProof.writes after a successful write and treat "unknown default effort" as "leave the agent's own default in place". Sending an explicit effort with the message whenever model is sent would also avoid the path.
Workaround
Align pi's startup model with the composer's selection so no option write is attempted, e.g. in ~/.pi/agent/settings.json:
{ "defaultProvider": "opencode-go", "defaultModel": "beam-free", "defaultThinkingLevel": "high" }Related: #31423 (ACP pending-handle race, retry usually recovers), and opencode models --verbose no longer existing in opencode 2.x, which breaks the opencode (v1) agent's model discovery — the separate opencode2 agent id is unaffected.
Activity
jasonvagner commentedon Oct 22, 2026
Found the same root cause hitting a second agent —
opencode2(ACP) — so posting the evidence here rather than in a separate issue, since the missing piece is identical:defaultEffortis never populated for a newly selected model.Symptom
Same user-visible string, different adapter. In an
opencode2chat, sending on any model that advertises a thinking level (opencode-go/beam-free,opencode/deepseek-v4.1-flash-free,deepseek/deepseek-flash, …) is rejected instantly. Models without thought levels (opencode/big-pickle) work.Evidence
Journal: rejection 4–15 ms after submit,
rejection.kind = providerRejected, handlepending.Captured the ACP wire by putting a tee shim in front of the
opencode2binary. Orca's writes all succeed and the prompt is simply never sent:For the record,
session/set_modelis gone in opencode 2.x (-32601 Method not found); Orca correctly usessession/set_config_optionhere, which opencode accepts formodel,effortandmode.Cause
yX()in the ACP runtime:opencode2's
session/newreports the effort ascurrentValue: "default", soreported().effort !== undefinedand the lookup falls to the catalog. Inagent-model-catalog.jsonon this machine every opencode2 entry hasdefaultEffort: None, including entries whoseeffortsarray does carry the values ([low, medium, high, xhigh, max, default]). Soc === undefined→ throw → the dispatch is recorded asproviderRejectedand nothing is written to the agent.Only models without a thinking level escape it: their
session/newhas noeffortconfig option, soreported().effortis undefined and the loop skips the effort key — which is exactly whyopencode/big-pickleworks today.(For contrast, the stale opencode-v1 entry in the same file, produced by the old
models --verboseparsing path, does havedefaultEffort: "low"— so the field is populated byj0()'s variant mapping, just never by the probe/ACP-configOptions paths, and never forpieither — see the repro in the original report.)Suggested fix
Either:
defaultEffortfrom the session'sconfigOptions(currentValuewhen it is a concrete level) or from the model'sefforts[0]when the reported value is the literal"default", or"default"as "let the agent decide" and skip the effort write instead of throwing.Workaround used here
Declaring the capability off in
opencode.jsoncremoves the effort option fromsession/new, which makes the session look likebig-pickle:Verified:
configOptionsbecomes[model, mode]and the chat works. Cost: no thinking-level control for those models in opencode, including the terminal.nwparker commentedon Oct 24, 2026
Thanks for the detailed report, @jasonvagner. 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.
jasonvagner commentedon Oct 26, 2026
It's working for me now. Thanks for the quick turn-around. Much appreciated.
nwparker commentedon Oct 27, 2026
This is fixed on main by #32004 (752f531): the ACP/Pi send guard now only refuses when Orca has already applied an effort that differs from the session's initial one, so a model-only change no longer rejects the prompt (and thanks for confirming it works for you). It shipped in v1.4.239. Closing — please reopen if you still see it on a build that includes that change.