Skip to content

mini: ignores the TUI's recent-model state and has no mini-scoped model setting #50376

Open

Description

@CyberTodBG

Summary

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)
  • Terminal: TERM=xterm-256color (TERM_PROGRAM/COLORTERM unset)
  • Shell: /bin/bash
  • Install/channel: latest
  • Active plugins: -opencode-pty, cc-safety-net@latest; local TUI plugins opencode-stats, ssh-remote, devices

Reproduction

  1. 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.
  2. Confirm ~/.local/state/opencode/model.json records it in recent.
  3. 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
  • opencode mini turn summary/footer shows Ternary Bonsai 2 27B · OpenRouter

Reproducible consistently.

Additional Context

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.json recent → 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.

Activity

  1. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    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.

    Related work you may want to follow:

    Until then, setting a root model in opencode.json (or passing -m) makes mini start on the model you want.

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

Metadata

Metadata

Assignees

No one assigned

    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