You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Non deterministic behaviour of variants passed into agents in the opencode.json config #16034
Even when passing in variants to agents, these don not still get used, switching to another variant makes that the new default and ignores what has been set in the config.
Try to update the variant of the build agent, and make request
Cycle round back to the build agent, notice the last variant is used rather than what is set in the config, same thing happens if you close the TUI and open again.
Leaving this here as it seems to be the same root cause. A collaborator (@ReqX) from the oh-my-opencode-slim repo traced this through both codebases and confirmed it's an upstream OpenCode core bug — still happens with oh-my-opencode-slim fully deactivated (plan/build built-in agents only).
TL;DR: Two independent variant stores (UI vs API session) get out of sync. Clearing or switching the variant in the UI only updates the UI side, so the API session keeps sending the old one. The next response overwrites your variant right back — ghost variant.
Clear/switch variant in dialog → only local UI store is updated, ACP session still holds "medium".
Switch mode (e.g. build → plan → build) — session variant is NOT cleared on mode switch.
Next prompt sends stale variant to API.
Response echoes msg.variant = "medium", and prompt/index.tsx:200 syncs that back into the local model store — undoing the clear.
Why this can't be fixed at the plugin level:
Plugin-level hooks only have access to agent.config.variant at startup. Runtime access to ACP session manager is not exposed, so any fix needs to happen in core.
Suggested fix areas in core:
dialog-variant.tsx: when user selects "Default", propagate that to ACP session via setVariant() in acp/session.ts:103.
prompt/index.tsx:200: stop unconditionally syncing msg.variant from API response back into local model store.
Activity
github-actions commentedon Mar 4, 2026
This issue might be a duplicate of existing issues. Please check:
mmack commentedon Mar 15, 2026
Same problem here
OpeOginni commentedon Mar 15, 2026
@mmack got a PR that fixes it, hopefully it gets merged or reviewed!
alexzoo commentedon Mar 31, 2026
Leaving this here as it seems to be the same root cause. A collaborator (@ReqX) from the oh-my-opencode-slim repo traced this through both codebases and confirmed it's an upstream OpenCode core bug — still happens with oh-my-opencode-slim fully deactivated (plan/build built-in agents only).
TL;DR: Two independent variant stores (UI vs API session) get out of sync. Clearing or switching the variant in the UI only updates the UI side, so the API session keeps sending the old one. The next response overwrites your variant right back — ghost variant.
Analysis by @ReqX
Two stores, one source of truth problem:
~/.opencode/model.jsonsession.variant(in-memory)The flow:
medium→ both stores updated."medium".build→plan→build) — session variant is NOT cleared on mode switch.msg.variant = "medium", andprompt/index.tsx:200syncs that back into the local model store — undoing the clear.Why this can't be fixed at the plugin level:
Plugin-level hooks only have access to
agent.config.variantat startup. Runtime access to ACP session manager is not exposed, so any fix needs to happen in core.Suggested fix areas in core:
dialog-variant.tsx: when user selects "Default", propagate that to ACP session viasetVariant()inacp/session.ts:103.prompt/index.tsx:200: stop unconditionally syncingmsg.variantfrom API response back into local model store.Original report + full analysis: alvinunreal/oh-my-opencode-slim#214
tarurar commentedon Apr 28, 2026
Same issue, I see there is an open pull request already: #18013.
github-actions commentedon Jul 5, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.