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
[BUG] Using --prompt causes the wrong model to be selected. #8551
When you just run opencode, it launches with the default model which the user has selected. This is good.
But when you then run opencode --prompt "What is this repo?", instead of exactly the same behavior but with the prompt, it launches with Gemini 3 Pro via Github as the provider.
Adding --prompt has nothing to do with the model. So forcing this model which will often fail, is an undesirable and unrelated outcome that appears to be a bug.
Plugins
No response
OpenCode version
1.1.20
Steps to reproduce
opencode --prompt "What is this repo?"
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
Reacted by Eli Oshinsky, Hayden, Flavio Garcia and WenZheng Li
Both issues appear to involve model selection being unintentionally changed when using different flags or commands (--prompt flag in this case, /command in #8452). The underlying cause may be related to how model defaults are handled when alternative invocation methods are used.
Feel free to ignore if this specific case differs from the linked issue.
To add to this, if you have "model", in your opencode.json, this bug doesn't appear. But if you don't and your default is the last selected model (most people are in this position), then the bug persists.
Activity
[-][BUG][/-][+][BUG] Using --prompt causes the wrong model to be selected.[/+]github-actions commentedon Jan 14, 2026
This issue might be a duplicate of existing issues. Please check:
Both issues appear to involve model selection being unintentionally changed when using different flags or commands (--prompt flag in this case, /command in #8452). The underlying cause may be related to how model defaults are handled when alternative invocation methods are used.
Feel free to ignore if this specific case differs from the linked issue.
arkaydeus commentedon Jan 14, 2026
To add to this, if you have "model", in your opencode.json, this bug doesn't appear. But if you don't and your default is the last selected model (most people are in this position), then the bug persists.
rekram1-node commentedon Jan 14, 2026
I believe there is a timing issue here where the prompt submits prior to the tui having last used model available
thdxr commentedon Mar 25, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.