Description
In Desktop v2 (new SolidJS UI), after sending a message, the model dropdown in the prompt input resets to the first available model alphabetically (e.g., alibaba-cn/kimi-*).
However, the actual message is still processed with the originally selected model — this is purely a visual UI bug where the dropdown selection state is lost after submit.
Desktop v1 (legacy UI) and TUI do not have this issue. The TUI had a similar bug which was fixed in PR #25993.
Steps to Reproduce
- Open OpenCode Desktop v2 (new UI design)
- Select a non-alphabetically-first model from the dropdown (e.g.,
opencode/deepseek-v4-flash-free)
- Type a message and press Enter
- Observed: The model dropdown immediately switches to
alibaba-cn/kimi-* (or whichever provider/model is alphabetically first in your connected providers list)
- The next message — if sent without manually re-selecting — uses the wrong model
Expected Behavior
The model dropdown should preserve the user's selection across message sends. After sending a message, the dropdown should still show the model that was selected before sending.
Environment
- OpenCode Desktop version: 1.15.13 (also confirmed on 1.16.0)
- Channel: latest
- OS: macOS (Apple Silicon)
- Plugins: oh-my-openagent, @tarquinen/opencode-dcp
- UI variant: Desktop v2 (newLayoutDesigns = true)
Confirmed: Visual Only
The actual message processing uses the correct model. Evidence:
- SQLite database shows 531+ messages all using
opencode/deepseek-v4-flash-free
- No
model-switched events recorded in the DB
- Response content confirms the intended model was used
Root Cause Analysis
The model dropdown reads from local.model.current() in packages/app/src/context/local.tsx. The resolution chain is:
scope()?.model → agent.current()?.model → fallback
↓
configuredModel() ?? recentModel() ?? defaultModel()
↓
first connected provider's first model
After message submit, SolidJS reactivity causes scope()?.model to briefly become undefined, causing the chain to fall through to defaultModel(), which returns the first model from the first connected provider (sorted by insertion order — typically alphabetical provider ID).
Related
Suggested Fix
Ensure that the model selection is preserved in local.tsx during the submit flow. The scope()?.model should remain stable after local.session.promote() is called and should not be invalidated by the reactivity chain that follows message submission.
Description
In Desktop v2 (new SolidJS UI), after sending a message, the model dropdown in the prompt input resets to the first available model alphabetically (e.g.,
alibaba-cn/kimi-*).However, the actual message is still processed with the originally selected model — this is purely a visual UI bug where the dropdown selection state is lost after submit.
Desktop v1 (legacy UI) and TUI do not have this issue. The TUI had a similar bug which was fixed in PR #25993.
Steps to Reproduce
opencode/deepseek-v4-flash-free)alibaba-cn/kimi-*(or whichever provider/model is alphabetically first in your connected providers list)Expected Behavior
The model dropdown should preserve the user's selection across message sends. After sending a message, the dropdown should still show the model that was selected before sending.
Environment
Confirmed: Visual Only
The actual message processing uses the correct model. Evidence:
opencode/deepseek-v4-flash-freemodel-switchedevents recorded in the DBRoot Cause Analysis
The model dropdown reads from
local.model.current()inpackages/app/src/context/local.tsx. The resolution chain is:After message submit, SolidJS reactivity causes
scope()?.modelto briefly becomeundefined, causing the chain to fall through todefaultModel(), which returns the first model from the first connected provider (sorted by insertion order — typically alphabetical provider ID).Related
Suggested Fix
Ensure that the model selection is preserved in
local.tsxduring the submit flow. Thescope()?.modelshould remain stable afterlocal.session.promote()is called and should not be invalidated by the reactivity chain that follows message submission.