opencode run command uses incorrect model after /models selection #532

Closed
opened 2026-02-16 17:27:12 -05:00 by yindo · 6 comments
Owner

Originally created by @xyb on GitHub (Jul 7, 2025).

Originally assigned to: @thdxr on GitHub.

I used the /models command in the TUI to select a specific model.
When re-entering the opencode TUI, the program correctly uses the previously selected model.
However, when I directly execute the opencode run command (outside the TUI), it uses a different model than the one I selected.

I will attach screenshots below showing the model used in the TUI and the model used when running opencode run directly.

Image Image
Originally created by @xyb on GitHub (Jul 7, 2025). Originally assigned to: @thdxr on GitHub. I used the `/models` command in the TUI to select a specific model. When re-entering the `opencode` TUI, the program correctly uses the previously selected model. However, when I directly execute the `opencode run` command (outside the TUI), it uses a different model than the one I selected. I will attach screenshots below showing the model used in the TUI and the model used when running `opencode run` directly. <img width="683" height="738" alt="Image" src="https://github.com/user-attachments/assets/e0dd738b-e8aa-42fe-ad68-82705edccaa4" /> <img width="377" height="212" alt="Image" src="https://github.com/user-attachments/assets/9f3597af-52f5-4d9e-8f2a-8362d5da2f61" />
yindo closed this issue 2026-02-16 17:27:12 -05:00
Author
Owner

@Yusuf007R commented on GitHub (Jul 7, 2025):

@xyb do you have any default model in the config.json?

@Yusuf007R commented on GitHub (Jul 7, 2025): @xyb do you have any default model in the config.json?
Author
Owner

@xyb commented on GitHub (Jul 8, 2025):

@Yusuf007R No. The config is attached below:

{
  "$schema": "https://opencode.ai/config.json",
  "disabled_providers": ["openai"]
}
@xyb commented on GitHub (Jul 8, 2025): @Yusuf007R No. The config is attached below: ``` { "$schema": "https://opencode.ai/config.json", "disabled_providers": ["openai"] } ```
Author
Owner

@cravenceiling commented on GitHub (Jul 8, 2025):

The issue is a feature actually haha. The thing is that when you select a model in the TUI it is stored in a different file to be used later as the recent used model. But that only works for the TUI.

@cravenceiling commented on GitHub (Jul 8, 2025): The issue is a feature actually haha. The thing is that when you select a model in the TUI it is stored in a different file to be used later as the recent used model. But that only works for the TUI.
Author
Owner

@xyb commented on GitHub (Jul 9, 2025):

@cravenceiling This behavior is unexpected. We should add a note to the run command's documentation to clarify it.

@xyb commented on GitHub (Jul 9, 2025): @cravenceiling This behavior is unexpected. We should add a note to the run command's documentation to clarify it.
Author
Owner

@xyb commented on GitHub (Jul 9, 2025):

And the Gemini CLI displays the default model name, which is more user-friendly. We can consider it as a reference. See below:

❯ gemini -h
Options:
  -m, --model                    Model      [string] [default: "gemini-2.5-pro"]
  -p, --prompt                   Prompt. Appended to input on stdin (if any).
                                                                        [string]
  -s, --sandbox                  Run in sandbox?                       [boolean]
@xyb commented on GitHub (Jul 9, 2025): And the Gemini CLI displays the default model name, which is more user-friendly. We can consider it as a reference. See below: ``` ❯ gemini -h Options: -m, --model Model [string] [default: "gemini-2.5-pro"] -p, --prompt Prompt. Appended to input on stdin (if any). [string] -s, --sandbox Run in sandbox? [boolean] ```
Author
Owner

@rekram1-node commented on GitHub (Sep 5, 2025):

will be fixed in next release

@rekram1-node commented on GitHub (Sep 5, 2025): will be fixed in next release
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#532