Skip to content

opencode run ignores recently used model from TUI #12667

Closed

Description

@smitchaudhary

Description

When using opencode run without --model (or any other way we specify the model), the CLI falls back to Provider.defaultModel() which picks a model based on sort priority. The TUI persists recently used models to model.json and checks them before falling back, but the CLI run path skips this. This means the CLI can select a different default model than what the user last used in the TUI.

Plugins

None

OpenCode version

1.1.53

Steps to reproduce

  1. Launch opencode (TUI) and switch to a model of your choice and then exit.
  2. Run opencode run 'Hello' without --model

And then if you see the session or see the model was used some other way, you will see that it did not respect our choice from the TUI

Screenshot and/or share link

No response

Operating System

macOS26.2

Terminal

Ghostty

Activity

  1. github-actions commented on Feb 8, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions