Skip to content

tui: configured Ollama models missing from /models despite API listing them #65787

Closed

Description

@mezzotokyo

Summary

Custom Ollama-backed providers defined in the global config are present in the server catalog (/api/model) and are printed by opencode models, but they do not appear in the TUI /models model dialog.

Environment

  • opencode version: v2.4.0
  • OS: Darwin 27.2.0 (darwin arm64)
  • Terminal: Apple_Terminal, TERM=xterm-256color, COLORTERM=truecolor
  • Shell: /bin/zsh
  • Install/channel: latest
  • Active plugins: none found in config; opencode plugin list reports "No plugins found"

Reproduction

  1. In ~/.config/opencode/opencode.json, define providers such as:

    {
      "providers": {
        "ollama": {
          "name": "Ollama (host A)",
          "package": "aisdk:@ai-sdk/openai-compatible",
          "settings": { "baseURL": "http://<host-a>:11434/v1" },
          "models": { "ta:engineer": { "name": "TA Engineer (Coding)" } }
        },
        "ollama-iride": {
          "name": "Ollama (host B)",
          "package": "aisdk:@ai-sdk/openai-compatible",
          "settings": { "baseURL": "http://<host-b>:11434/v1" },
          "models": { "iride:engineer": { "name": "Iride Engineer (Coding)" } }
        }
      }
    }

    Both endpoints are reachable and return HTTP 200 from /api/tags.

  2. Launch the full-screen TUI with opencode (no --standalone or --server).

  3. Run /models (or Ctrl+X, then M).

  4. Observe that only opencode/* models are offered; no ollama/* or ollama-iride/* entries.

  5. In another terminal, run opencode models: all 11 Ollama models are listed.

  6. opencode api get /api/model returns the same 11 models with enabled: true and status: active.

Expected Behavior

/models should offer the same enabled models that opencode models and /api/model return, including the configured Ollama models.

Actual Behavior

The Ollama models are missing from the TUI model dialog. The user reports the problem still occurs. opencode models and the API show no discrepancy on the server side.

Additional Context

  • Model list from opencode models (11 entries): ollama/ta:engineer, ollama/ta:auditor, ollama/ta:architect, ollama/gemma4:12b-nvfp4, ollama/qwen3.5:9b-nvfp4, and six ollama-iride/iride:* entries.
  • /api/model?types=chat also returns all 11, so the models are considered chat models by the API.
  • The older discovery warnings in ~/.local/share/opencode/log/opencode.log (EHOSTUNREACH, ECONNREFUSED, timeouts) do not match the current state: both hosts now answer /api/tags with HTTP 200.
  • The config uses the legacy-looking aisdk:@ai-sdk/openai-compatible package string; the server reports it normalized to @opencode/ai/providers/openai-compatible.
  • No plugins, policies, or provider-disable directives are configured.
  • Hostnames/IPs and custom model names are redacted in this report.

Activity

  1. opencodejr commented on Nov 23, 2026

    @opencodejr
    Contributor

    Thanks for the detailed report, and for checking opencode models and /api/model. Those checks show the server side is fine.

    I think this is a duplicate of #60587. In v2.4.0 the TUI's "new designs" experiment is on by default. With it on, /models treats you as "connected" only if an integration has a saved connection, for example from /connect. A provider defined only in opencode.json, like your two Ollama providers, doesn't create one. So the TUI opens the Free models picker, which lists only OpenCode's free models. That matches what you see: only opencode/* models in the dialog, while the server lists all 11 Ollama models.

    A possible workaround until this is fixed: turn the experiment off in ~/.config/opencode/cli.json:

    {
      "experimental": { "new-designs": false }
    }

    In #60587, turning it off brought back the normal "Select model" dialog with the configured models.

    Possible duplicates and related issues, ordered by likelihood:

    I'm closing this issue now as a duplicate of #60587. Please add your details there (v2.4.0, macOS, two Ollama providers). If you do have a saved /connect connection, or the models are still missing with new-designs set to false, then this is a different problem: reply here and the issue will reopen.

  2. added
    area/tui
    type/bug
    version/v2
    on Nov 23, 2026
  3. mezzotokyo commented on Nov 23, 2026

    @mezzotokyo
    Author

    追加の切り分け結果です。

    • コンピューターを再起動した直後、v2.3.2 では TUI の /models に Ollama モデルが表示されました。
    • その後 opencode upgrade 2.4.0 --method curl で再アップグレードし、サービスも再起動したところ、再度 /models に Ollama モデルが表示されなくなりました。
    • opencode models と /api/model は v2.4.0 でも相変わらず 11 件の Ollama モデルを返します。

    このことから、v2.4.0 の TUI モデルダイアログ側の回帰である可能性が高いです。

  4. opencodejr commented on Nov 23, 2026

    @opencodejr
    Contributor

    切り分けありがとうございます。v2.3.2 では表示され、v2.4.0 で表示されなくなるという結果は、前回お伝えした原因と一致します。

    v2.4.0 の TUI では、「new designs」という実験的機能が、設定で false にしない限りオンになります。以前のバージョンでは設定でオンにする必要がありました。#60587 の報告者も、2.2.3 で自分でオンにしていました。この機能がオンで、/connect などで保存した接続が一つもない場合、/models は無料モデルだけを並べる「Free models」ダイアログに切り替わります。opencode.json だけで定義したプロバイダー(今回の Ollama の二つ)は「接続済み」として数えられません。そのため、サーバー側(opencode models や /api/model)には 11 件あっても、ダイアログには opencode/* しか出ません。

    つまり、ご利用の環境から見れば v2.4.0 での回帰ですが、原因は #60587 と同じなので、そちらで扱います。

    修正されるまでの回避策として、~/.config/opencode/cli.json で実験的機能をオフにしてみてください。#60587 では、オフにすると設定済みのモデルが再び表示されました。

    {
      "experimental": { "new-designs": false }
    }

    この設定にしても v2.4.0 で Ollama モデルが /models に表示されない場合は、別の問題ですので、ここに返信してください。その場合はこの issue が再オープンされます。表示される場合は、#60587 に「v2.3.2 では問題なく、v2.4.0 から発生した」という情報を追記していただけると助かります。

  5. mezzotokyo commented on Nov 23, 2026

    @mezzotokyo
    Author

    訂正・補足です。

    先ほど「コンピューター再起動後に v2.3.2 で表示された」と書きましたが、再起動自体は解消条件ではありませんでした。その後確認したところ、opencode upgrade 2.3.2 --method curl と opencode service restart だけで正常に表示されました。TUI を開き直すだけで、コンピューターの再起動は不要です。

    まとめると:

    • v2.4.0: /models に Ollama モデルが表示されない(opencode models / /api/model には 11 件存在)
    • v2.3.2 にダウングレード + サービス再起動: 正常に表示される
    • v2.4.0 に戻す: 再び非表示になる

    つまり v2.4.0 の TUI 側の回帰が原因と思われます。

  6. opencodejr commented on Nov 23, 2026

    @opencodejr
    Contributor

    訂正ありがとうございます。再起動は関係なく、バージョン(v2.3.2 か v2.4.0 か)だけで結果が変わるということですね。これは前回のコメントでご説明した内容と一致します。v2.4.0 の TUI では「new designs」という実験的機能が、設定で false にしない限りオンになります。この機能がオンで保存済みの接続がない場合、/models は無料モデルだけの一覧に切り替わります。原因は #60587 と同じです。

    v2.4.0 のまま、~/.config/opencode/cli.json に次の設定を入れて TUI を開き直すと、Ollama モデルが表示されるか確認していただけますか。

    {
      "experimental": { "new-designs": false }
    }

    表示されれば #60587 と同じ問題ですので、「v2.3.2 では問題なく、v2.4.0 から発生した」という情報を #60587 に追記していただけると助かります。この設定でも表示されない場合は、ここに返信してください。その場合はこの issue が再オープンされます。

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/bugversion/v2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions