Skip to content

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

Closed

Description

@xyb

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

Activity

  1. self-assigned this
    on Jul 7, 2025
  2. Yusuf007R commented on Jul 7, 2025

    @Yusuf007R

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

  3. xyb commented on Jul 8, 2025

    @xyb
    Author

    @Yusuf007R No. The config is attached below:

    {
      "$schema": "https://opencode.ai/config.json",
      "disabled_providers": ["openai"]
    }
    
  4. cravenceiling commented on Jul 8, 2025

    @cravenceiling
    Contributor

    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.

  5. xyb commented on Jul 9, 2025

    @xyb
    Author

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

  6. xyb commented on Jul 9, 2025

    @xyb
    Author

    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]
    
  7. rekram1-node commented on Sep 5, 2025

    @rekram1-node
    Collaborator

    will be fixed in next release

  8. added a commit that references this issue on Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions