Skip to content

tui: /models picker hides config-defined providers (only free models shown until an integration is connected) #65802

Closed as duplicate

Description

@KickUasS

Description

In v2.4.0 the TUI /models dialog only shows free models ("Free models · Connect a provider for access to more models") when no integration is connected. Models from providers defined directly in opencode.json (V2 syntax: providers.<id> + settings.apiKey) are missing from the picker — search can't find them either — even though the server knows them: opencode models (CLI) lists them and GET /api/model on the running server returns them. Runtime model use works fine.

This comes from the new integrations flow. In the shipped TUI bundle:

  • /models renders a free-only dialog when tq(integration.list()) is false
  • tq = t.some(r => r.connections.length > 0) — at least one integration must have a connection
  • the free-only list filters models by cost.length > 0 && cost.every(c => c.input === 0)

Config-defined providers never create an integration connection, so setups that only use config-file providers (self-hosted gateways, custom OpenAI-compatible endpoints) are stuck on the free-models upsell and cannot switch models from the TUI at all.

Regression: worked in ≤ 2.3.2. Not plugin-related — reproduced with all plugins removed.

Reported by @KickUasS

Steps to reproduce

  1. Define a custom provider in opencode.json:
    {
      "providers": {
        "my-gateway": {
          "name": "My Gateway",
          "package": "@opencode/ai/providers/openai-compatible",
          "settings": { "baseURL": "https://example.com/v1", "apiKey": "sk-..." },
          "models": { "my-model": {} }
        }
      }
    }
  2. Start the TUI, run /models
  3. The dialog shows only "Free models"; searching for the custom model finds nothing
  4. Confirm the server has them: opencode models lists them, GET /api/model returns them

Workaround

Connecting any one integration flips the picker to the full grouped list (e.g. /connect, or POST /api/integration/<id>/connect/key). After that /models shows all providers, including config-defined ones.

Expected

Config-defined providers (credentials already present in config) should either count as connected, or the full model picker should always list their models.

Environment

  • OpenCode version: 2.4.0 (channel: latest)
  • OS: Ubuntu 24.04 (Linux 7.0.0-43-generic, x86_64)
  • Terminal: xterm-256color
  • Plugins: none required to reproduce (tested with opencode-models-discovery, opencode-pty, opencode-conductor-plugin, opencode-goal-plugin installed and with plugins removed)

Activity

  1. opencodejr commented on Nov 23, 2026

    @opencodejr
    Contributor

    Thanks for the clear analysis. I think this is a duplicate of #60587.

    Possible duplicates and related issues, ordered by likelihood:

    Until you are on a version with that fix, the workaround you found (connecting any one integration) still works.

    I'm closing this issue now as a duplicate of #60587. If you have more details, please add them there. If you reply here, this issue will reopen.

  2. added
    area/tui
    type/bug
    version/v2
    on Nov 23, 2026
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/tuiplatform/linuxtype/bugversion/v2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions