Skip to content

tui: model dialog hides a provider model that search finds #64321

Closed

Description

@aregander

Summary

The TUI model dialog omits one model from a provider's group even though the
model is present in the server catalog (/api/model) and selectable via search.
With a provider exposing three models, only two are listed under the provider
heading; the third can only be found by typing in the search field.

Environment

  • opencode version: 2.3.0 (opencode v2.3.0, Homebrew opencode-v2/2.3.0)
  • OS: macOS 27.0.0, Darwin 27.0.0 arm64 (RELEASE_ARM64_T6041)
  • Terminal: Ghostty (TERM_PROGRAM=ghostty, TERM=xterm-256color, COLORTERM=truecolor)
  • Shell: /bin/zsh
  • Install/channel: Homebrew release build (/opt/homebrew/Cellar/opencode-v2/2.3.0/bin/opencode), TUI and background service are the same binary
  • Active plugins: ./plugins/ollama-models (local), ./plugins/searxng (local), superpowers@git+https://github.com/obra/superpowers.git#v7.0.1

Reproduction

  1. Configure an OpenAI-compatible provider with three models, e.g. an Ollama
    server on the LAN that reports qwen3.8:27b-mlx, bonsai-2:27b,
    gemma4:26b-mlx from /v1/models.
  2. Declare the three models explicitly in opencode.json under
    providers.<id>.models (identical id/name, capabilities.tools: true,
    input: ["text","image"], output: ["text"]).
  3. Confirm the server-side catalog contains all three
    (GET /api/model → 3 entries with providerID: "localAIserver",
    status: "active", enabled: true).
  4. Open the TUI model dialog and look under the provider heading
    "Local AI Server".
  5. Observe only bonsai-2:27b and gemma4:26b-mlx. Type part of
    qwen3.8 in the search field → qwen3.8:27b-mlx appears and can be selected
    and used.

Expected Behavior

All three provider models are listed under the "Local AI Server" heading, in the
same way search shows them.

Actual Behavior

qwen3.8:27b-mlx is missing from the provider group. It is not hidden by a
config field (no hidden/status/disabled on the model), and it is fully
present in the catalog:

{
  "id": "qwen3.8:27b-mlx",
  "modelID": "qwen3.8:27b-mlx",
  "providerID": "localAIserver",
  "name": "qwen3.8:27b-mlx",
  "capabilities": { "tools": true, "input": ["text", "image"], "output": ["text"] },
  "variants": [],
  "status": "active",
  "enabled": true,
  "limit": { "context": 200000, "output": 32000 }
}

Additional Context

Consistently reproducible (not intermittent). Restarting the TUI and running
/reload did not change it; declaring the models in opencode.json instead of
relying on a plugin provider.transform did not change it either.

Provider config (no secrets):

"localAIserver": {
  "name": "Local AI Server",
  "package": "@opencode/ai/providers/openai-compatible",
  "settings": { "baseURL": "http://<lan-host>:11434/v1" },
  "models": {
    "qwen3.8:27b-mlx": { "name": "qwen3.8:27b-mlx", "capabilities": { "tools": true, "input": ["text", "image"], "output": ["text"] } },
    "bonsai-2:27b":    { "name": "bonsai-2:27b",    "capabilities": { "tools": true, "input": ["text", "image"], "output": ["text"] } },
    "gemma4:26b-mlx":  { "name": "gemma4:26b-mlx",  "capabilities": { "tools": true, "input": ["text", "image"], "output": ["text"] } }
  }
}

GET /api/provider/localAIserver returns the provider without a models array,
while GET /api/model lists all three — so the dialog and the catalog disagree.

Possible trigger worth checking in the dialog logic: qwen3.8:27b-mlx is the
only one of the three that appears in ~/.local/state/opencode/model.json under
recent:

{"providerID":"localAIserver","modelID":"qwen3.8:27b-mlx"}

The same file also holds stale references, e.g. {"providerID":"ollama", "modelID":"gemma4:26b-mlx"} for a model that only exists under localAIserver.
Suspicion: the dialog de-duplicates provider-group entries against
recent/favorite keys and, for a key that resolves to a different provider (or
for IDs containing : / .), drops the entry from the provider group without
rendering it in the recents group.

Workaround: search for the model name in the dialog.

Activity

  1. aregander commented on Nov 16, 2026

    @aregander
    Author

    Additional confirmation (2026-11-17): the model dialog shows the "Local AI Server" group with only bonsai-2:27b and gemma4:26b-mlx. This is still the case after declaring all three models explicitly under providers.localAIserver.models in opencode.json and reloading; GET /api/model continues to return qwen3.8:27b-mlx for the same provider with status: active and enabled: true. A screenshot of the dialog has been captured by the reporter.

  2. opencodejr commented on Nov 16, 2026

    @opencodejr
    Contributor

    Thanks for the detailed report, and for pointing at recent in model.json. That's what explains it.

    I think this is a duplicate of #60267. When the search box is empty, the TUI model dialog shows Favorites and Recent sections at the top. Any model listed there is taken out of its provider group, so it isn't shown twice. qwen3.8:27b-mlx is the only one of your three models in recent for localAIserver, so it should appear under Recent at the top of the list rather than under Local AI Server. Typing a search turns those sections off, which is why the model shows up under its provider again then. This is how the dialog is built at the moment, and #60267 asks for provider groups to always list every model.

    Possible duplicates and related issues, ordered by likelihood:

    I'm closing this issue now as a duplicate of #60267. Please add your details there. If qwen3.8:27b-mlx doesn't appear anywhere in the dialog with the search box empty (not under Recent either), that's a different problem. In that case, reply here with a screenshot of the whole list, scrolled from top to bottom, and the issue will reopen.

  3. added
    area/tui
    type/feature
    version/v2
    on Nov 16, 2026
  4. opencodejr commented on Nov 16, 2026

    @opencodejr
    Contributor

    Thanks for checking again. What you describe under Local AI Server is what we'd expect, though. With the search box empty, the dialog takes any model listed in Recent or Favorites out of its provider group. Declaring the models in opencode.json or reloading doesn't change that. qwen3.8:27b-mlx is in your recent list, so it should appear in the Recent section at the top of the dialog instead.

    The one thing that decides whether this is a bug is:

    1. Open the model dialog with the search box empty and look at the very top. Is qwen3.8:27b-mlx listed under Recent (or Favorites)?

    If it is, the dialog is working as designed, and #60267 tracks the request to keep provider groups complete. If it isn't listed anywhere with the search empty, please attach the screenshot you mentioned (it didn't come through in the comment), showing the whole list from the top. Then we'll treat it as a bug and look into it.

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

    area/tuipending closeplatform/macostriagingtype/featureversion/v2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions