Skip to content

tui: /model search no longer matches provider names #60851

Closed as not planned

Description

@YamineRL

Description

In the TUI /model picker, typing a provider name (for example opencode or a custom provider id) no longer lists that provider's models. Only model titles match.

useConnected() in packages/tui/src/component/use-connected.tsx calls data.location.integration.list() with no location ref, so it reads the default location's list instead of the TUI's current location. It gets [], connected() is false, the option category (the provider name) is undefined, and fuzzysort has nothing to match on except the title. The other lists in the picker already pass location.ref.

Plugins

None needed to reproduce

OpenCode version

2.2.0

Steps to reproduce

  1. Have at least one connected provider
  2. Open the TUI and run /model
  3. Type the provider id, for example opencode
  4. No models from that provider are listed

Operating System

Linux (CachyOS)

Terminal

tmux / kitty

Activity

  1. opencodejr commented on Oct 31, 2026

    @opencodejr
    Contributor

    Thanks for the detailed write-up and for pointing at useConnected(). I couldn't reproduce this on 2.2.0, though.

    What I tried, with a connected provider whose name doesn't appear in its model's title:

    • Opened the TUI, ran /models and typed the provider name: its model was listed, and the provider headers were shown.
    • Ran /cd into another directory and repeated the search: it still matched.

    You're right that useConnected() calls data.location.integration.list() without location.ref, unlike the other lists in the picker (#60591 changes this). In my runs it didn't matter, because the default location's integration list also had the connection. The bug would only show when the default location's list is empty, so something in your setup is probably different. Could you tell us:

    • How you start OpenCode: plain opencode in the project, -c/-s to open an existing session, --server, --standalone, or the background service?
    • Whether the session or directory you're in differs from where you launched it (for example after /cd, opening a session from another project, or using workspaces).
    • How the provider is connected: /connect with an API key or OAuth, an environment variable, or a custom provider in opencode.json (global or project-level)?
    • Whether the /models list shows provider group headers when the search box is empty.

    Related:

  2. YamineRL commented on Oct 31, 2026

    @YamineRL
    Author

    Thanks for checking. I can't reproduce it now either: the same 2.2.0 binary matches provider names again, so it looks state-dependent.

    1. Plain opencode (sometimes through a wrapper that only sets OPENCODE_CONFIG), attached to the background service. When it broke, the service had just been started after a reboot by the first client, from a different directory than the one I later opened.
    2. Possibly: I move between projects a lot, and I can't say for sure whether that session was opened from another directory.
    3. Both: custom providers in the global opencode.json (no /connect), and others connected with /connect and an API key.
    4. Not sure for the broken state. Now, with search working, the empty list shows no group headers.

    Since #60591 also makes useConnected() read the current location, I'm happy to close this PR in favour of it. I'll report back with exact steps if it happens again.

  3. Tarquinen commented on Nov 2, 2026

    @Tarquinen
    Member

    Thanks for checking! Since this no longer reproduces, I'm closing this issue. If it happens again, please open a new issue with the steps.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

  4. opencodejr commented on Nov 3, 2026

    @opencodejr
    Contributor

    We haven't heard back, so I'm closing this for now as not planned.

    On 2.2.0, searching by provider name in /models worked for me with a connected provider, both in the default location and after /cd. The missing location.ref in useConnected() is real, but it only causes this symptom when the default location's integration list is empty. To find out how that happens in your setup, I asked how you start OpenCode, which location or session you're in, and how the provider is connected.

    If it still happens, please reply with those details and we can reopen this. Related: #60590 / #60591, which also makes use-connected read the current location.

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