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
mini: ignores the TUI's recent-model state and has no mini-scoped model setting #50376
opencode mini ignores the client-side recent-model state that the TUI uses for new sessions, so it starts on the newest catalog model instead of the model last used in the TUI. There is no mini-scoped model setting, so the only fixes are per-invocation -m or --continue.
Environment
opencode version: 2.0.12
OS: Linux 5.15.153.1-microsoft-standard-WSL2 (linux x64)
Active plugins: -opencode-pty, cc-safety-net@latest; local TUI plugins opencode-stats, ssh-remote, devices
Reproduction
With no root model in opencode.json(c), select a model in the TUI that differs from the catalog default, e.g. opencode-go/deepseek-v4.1-flash.
Confirm ~/.local/state/opencode/model.json records it in recent.
Quit the TUI and run opencode mini with no -m/--model.
Expected Behavior
Mini resolves a new session's model the same way the TUI does: agent model → root config model → first available entry in the shared recent-model state → newest catalog model. Here that would be opencode-go/deepseek-v4.1-flash.
Actual Behavior
Mini skips the recent-model state and uses the newest catalog model.
GET /api/model/default → openrouter/prism-ml/ternary-bonsai-2-27b ("Ternary Bonsai 2 27B")
model.json → recent[0] available entry is opencode-go/deepseek-v4.1-flash, which the TUI uses for new sessions
The two clients share state but not the resolution logic:
The TUI client resolves a new session's model as agent.model → root config model → first available entry in model.jsonrecent → newest catalog model.
The mini client's preferences store only implements resolveVariant/saveVariant against the same model.json; it never reads recent (or favorite), so mini falls through to the catalog default.
cli.json has a mini settings group but no model/agent key, and unknown settings are rejected, so there is no mini-scoped way to set a default model.
Note: a stale recent entry silently changes the TUI's new-session model too (the first entry must both still exist and be available), so this state is worth surfacing in both clients.
Requested: either have mini honor the shared recent-model resolution, or add a mini-scoped model setting.
Thanks for the detailed write-up! To restate the request: opencode mini should pick its starting model the same way the TUI does, using the recent model saved in model.json after the agent and config models. Or there should be a mini-only model setting in cli.json. Right now mini only shares the saved reasoning variant with the TUI, so with no -m it falls back to the server's default model. That's how it was built rather than a bug, but the mismatch with the TUI is a fair point, and maintainers will consider it.
Activity
opencodejr commentedon Oct 28, 2026
Thanks for the detailed write-up! To restate the request:
opencode minishould pick its starting model the same way the TUI does, using the recent model saved inmodel.jsonafter the agent and config models. Or there should be a mini-only model setting incli.json. Right now mini only shares the saved reasoning variant with the TUI, so with no-mit falls back to the server's default model. That's how it was built rather than a bug, but the mismatch with the TUI is a fair point, and maintainers will consider it.Related work you may want to follow:
Until then, setting a root
modelinopencode.json(or passing-m) makes mini start on the model you want.