/model TUI picker does not display all custom provider models (models load correctly but don't appear in UI) #3869

Closed
opened 2026-02-16 17:41:45 -05:00 by yindo · 9 comments
Owner

Originally created by @MasuRii on GitHub (Dec 25, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

Custom models defined in opencode.jsonc under custom providers are correctly loaded by OpenCode (verified via opencode models --verbose), but many of them do not appear in the /model TUI picker dialog.

Key observation: Models that have been used recently appear in the "Recent" section, proving they are functional. However, when scrolling through the provider sections in the picker, many models are missing from the list.

Evidence

Models loaded (via opencode models): 23 models across 3 providers
Models visible in /model picker: ~15 models (varies based on Recent section)

Provider Models in Config Models in /model Picker Missing
aistudio (custom) 7 2 (+ some in Recent) 5
myproxy (custom) 12 ~8 ~4
opencode (built-in) 4 4 0

Example missing models:

  • aistudio/gemini-2.5-pro - loads correctly, not in picker
  • aistudio/gemini-3-pro-preview - loads correctly, not in picker
  • myproxy/antigravity/claude-opus-4-5 - loads correctly, not in picker

OpenCode version

1.0.201

Steps to reproduce

  1. Create a custom provider in opencode.jsonc with multiple models:
{
  "provider": {
    "myproxy": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "My Custom Proxy",
      "options": {
        "baseURL": "http://127.0.0.1:8000/v1"
      },
      "models": {
        "model-a": { "name": "Model A", "limit": { "context": 100000, "output": 8192 } },
        "model-b": { "name": "Model B", "limit": { "context": 100000, "output": 8192 } },
        "model-c": { "name": "Model C", "limit": { "context": 100000, "output": 8192 } },
        "model-d": { "name": "Model D", "limit": { "context": 100000, "output": 8192 } },
        "model-e": { "name": "Model E", "limit": { "context": 100000, "output": 8192 } },
        "model-f": { "name": "Model F", "limit": { "context": 100000, "output": 8192 } },
        "model-g": { "name": "Model G", "limit": { "context": 100000, "output": 8192 } }
      }
    }
  }
}
  1. Run opencode models to verify all models are loaded correctly
  2. Launch OpenCode TUI and type /model
  3. Scroll through the provider section - observe that not all models appear

Expected behavior

All models returned by opencode models should be visible in the /model TUI picker under their respective provider sections.

Actual behavior

Only a subset of custom provider models appear in the picker. The missing models:

  • Are correctly parsed and loaded (confirmed via opencode models --verbose)
  • Work correctly when set as "model" in config
  • Appear in "Recent" section after being used
  • Simply don't render in the provider list of the /model dialog

Workaround

You can still use missing models by:

  1. Setting them directly in config: "model": "myproxy/model-name"
  2. Using them once, then selecting from "Recent" section

Screenshot and/or share link

Image Image

Operating System

Windows 10 (Build 22631)

Terminal

Windows Terminal / VS Code Integrated Terminal


Additional context

Potentially related code: The model picker is implemented in packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx. The filtering logic intentionally removes models that are in "Recent" or "Favorites" to avoid duplication, but there may be an additional issue causing other models to not render.

Debug info:

  • All 23 models load correctly via Provider.list()
  • The sync.data.provider array contains all providers and models
  • Issue appears to be in the TUI rendering/display layer, not config parsing
Originally created by @MasuRii on GitHub (Dec 25, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description Custom models defined in `opencode.jsonc` under custom providers are correctly loaded by OpenCode (verified via `opencode models --verbose`), but many of them do not appear in the `/model` TUI picker dialog. **Key observation:** Models that have been used recently appear in the "Recent" section, proving they are functional. However, when scrolling through the provider sections in the picker, many models are missing from the list. ### Evidence **Models loaded (via `opencode models`):** 23 models across 3 providers **Models visible in `/model` picker:** ~15 models (varies based on Recent section) | Provider | Models in Config | Models in `/model` Picker | Missing | |----------|-----------------|---------------------------|---------| | `aistudio` (custom) | 7 | 2 (+ some in Recent) | 5 | | `myproxy` (custom) | 12 | ~8 | ~4 | | `opencode` (built-in) | 4 | 4 | 0 | **Example missing models:** - `aistudio/gemini-2.5-pro` - loads correctly, not in picker - `aistudio/gemini-3-pro-preview` - loads correctly, not in picker - `myproxy/antigravity/claude-opus-4-5` - loads correctly, not in picker ### OpenCode version 1.0.201 ### Steps to reproduce 1. Create a custom provider in `opencode.jsonc` with multiple models: ```jsonc { "provider": { "myproxy": { "npm": "@ai-sdk/openai-compatible", "name": "My Custom Proxy", "options": { "baseURL": "http://127.0.0.1:8000/v1" }, "models": { "model-a": { "name": "Model A", "limit": { "context": 100000, "output": 8192 } }, "model-b": { "name": "Model B", "limit": { "context": 100000, "output": 8192 } }, "model-c": { "name": "Model C", "limit": { "context": 100000, "output": 8192 } }, "model-d": { "name": "Model D", "limit": { "context": 100000, "output": 8192 } }, "model-e": { "name": "Model E", "limit": { "context": 100000, "output": 8192 } }, "model-f": { "name": "Model F", "limit": { "context": 100000, "output": 8192 } }, "model-g": { "name": "Model G", "limit": { "context": 100000, "output": 8192 } } } } } } ``` 2. Run `opencode models` to verify all models are loaded correctly 3. Launch OpenCode TUI and type `/model` 4. Scroll through the provider section - observe that not all models appear ### Expected behavior All models returned by `opencode models` should be visible in the `/model` TUI picker under their respective provider sections. ### Actual behavior Only a subset of custom provider models appear in the picker. The missing models: - Are correctly parsed and loaded (confirmed via `opencode models --verbose`) - Work correctly when set as `"model"` in config - Appear in "Recent" section after being used - Simply don't render in the provider list of the `/model` dialog ### Workaround You can still use missing models by: 1. Setting them directly in config: `"model": "myproxy/model-name"` 2. Using them once, then selecting from "Recent" section ### Screenshot and/or share link <img width="427" height="567" alt="Image" src="https://github.com/user-attachments/assets/df6ff62f-fe1d-4700-96c7-f73d6a3f8c4d" /> <img width="445" height="505" alt="Image" src="https://github.com/user-attachments/assets/3cbc01e9-0d73-494f-94cd-026cdb2b9c1f" /> ### Operating System Windows 10 (Build 22631) ### Terminal Windows Terminal / VS Code Integrated Terminal --- ### Additional context **Potentially related code:** The model picker is implemented in `packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx`. The filtering logic intentionally removes models that are in "Recent" or "Favorites" to avoid duplication, but there may be an additional issue causing other models to not render. **Debug info:** - All 23 models load correctly via Provider.list() - The sync.data.provider array contains all providers and models - Issue appears to be in the TUI rendering/display layer, not config parsing
yindo added the opentui label 2026-02-16 17:41:45 -05:00
yindo closed this issue 2026-02-16 17:41:45 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 25, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #4232: OpenCode displays models which aren't configured & don't exist in LM Studio (similar issue with models not appearing correctly in the picker)
  • #2223: Cloudflare Workers AI models not appearing in interactive interface (custom provider models not showing in interactive interface/picker)
  • #5533: Confusing/inconsistent recent models UX (related to recent models display logic in the picker)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Dec 25, 2025): This issue might be a duplicate of existing issues. Please check: - #4232: OpenCode displays models which aren't configured & don't exist in LM Studio (similar issue with models not appearing correctly in the picker) - #2223: Cloudflare Workers AI models not appearing in interactive interface (custom provider models not showing in interactive interface/picker) - #5533: Confusing/inconsistent recent models UX (related to recent models display logic in the picker) Feel free to ignore if none of these address your specific case.
Author
Owner

@MasuRii commented on GitHub (Dec 25, 2025):

It's working now, I deleted the models in C:\Users\Administrator.local\state\opencode, as somehow that's the one causing issue. Is there a way to avoid this in the future please? so that I wont have to keep deleting the state.

Image
@MasuRii commented on GitHub (Dec 25, 2025): It's working now, I deleted the models in C:\Users\Administrator\.local\state\opencode, as somehow that's the one causing issue. Is there a way to avoid this in the future please? so that I wont have to keep deleting the state. <img width="610" height="593" alt="Image" src="https://github.com/user-attachments/assets/85daa9dd-00ea-4385-b842-a9a9183b1e55" />
Author
Owner

@pablonification commented on GitHub (Dec 26, 2025):

this happens on my opencode too, try to debug this for a hour to finding out it's a global issue.

to fix, im deleting the model.json from /Users/macbook/.local/state/opencode/model.json then suddenly it works lmao

@pablonification commented on GitHub (Dec 26, 2025): this happens on my opencode too, try to debug this for a hour to finding out it's a global issue. to fix, im deleting the model.json from /Users/macbook/.local/state/opencode/model.json then suddenly it works lmao
Author
Owner

@tqian86 commented on GitHub (Dec 26, 2025):

this happens on my opencode too, try to debug this for a hour to finding out it's a global issue.

to fix, im deleting the model.json from /Users/macbook/.local/state/opencode/model.json then suddenly it works lmao

On Linux, the equivalent file is ~/.cache/opencode/models.json, but deleting it has no effect. The models are still missing from the pick TUI.

@tqian86 commented on GitHub (Dec 26, 2025): > this happens on my opencode too, try to debug this for a hour to finding out it's a global issue. > > to fix, im deleting the model.json from /Users/macbook/.local/state/opencode/model.json then suddenly it works lmao On Linux, the equivalent file is ~/.cache/opencode/models.json, but deleting it has no effect. The models are still missing from the pick TUI.
Author
Owner

@peaster commented on GitHub (Dec 27, 2025):

Reproduced this and confirmed that deleting ~/.cache/opencode/models.json has no effect on Linux

@peaster commented on GitHub (Dec 27, 2025): Reproduced this and confirmed that deleting `~/.cache/opencode/models.json` has no effect on Linux
Author
Owner

@MasuRii commented on GitHub (Dec 27, 2025):

@tqian86
@peaster

Try looking for the "state" folder, as I also tried to delete that in the .cache and it's not working, that's not the correct folder.

@MasuRii commented on GitHub (Dec 27, 2025): @tqian86 @peaster Try looking for the "state" folder, as I also tried to delete that in the .cache and it's not working, that's not the correct folder.
Author
Owner

@akirabaruah commented on GitHub (Dec 27, 2025):

I'm on a Mac. I initially tried deleting models.json under ~/.cache/, which didn't work:

rm ~/.cache/opencode/models.json

But based on https://github.com/sst/opencode/issues/6169#issuecomment-3691743028 and https://github.com/sst/opencode/issues/6169#issuecomment-3694288155, I tried deleting the file under ~/.local/ instead, which fixed the issue for me:

rm ~/.local/state/opencode/model.json

Thanks @MasuRii 🙏

@akirabaruah commented on GitHub (Dec 27, 2025): I'm on a Mac. I initially tried deleting `models.json` under `~/.cache/`, which didn't work: ``` rm ~/.cache/opencode/models.json ``` But based on https://github.com/sst/opencode/issues/6169#issuecomment-3691743028 and https://github.com/sst/opencode/issues/6169#issuecomment-3694288155, I tried deleting the file under `~/.local/` instead, which fixed the issue for me: ``` rm ~/.local/state/opencode/model.json ``` Thanks @MasuRii 🙏
Author
Owner

@rekram1-node commented on GitHub (Dec 27, 2025):

This is the same issue as this:
https://github.com/sst/opencode/issues/6251#issuecomment-3694363092

there was a bug w/ the recents list for model picker. Added a fix for it, will be in next release

@rekram1-node commented on GitHub (Dec 27, 2025): This is the same issue as this: https://github.com/sst/opencode/issues/6251#issuecomment-3694363092 there was a bug w/ the recents list for model picker. Added a fix for it, will be in next release
Author
Owner

@chindris-mihai-alexandru commented on GitHub (Dec 30, 2025):

This issue still persists in v1.0.218.

My setup:

  • OpenCode version: 1.0.218
  • OS: macOS 15.7.4 (Build 24G503)
  • Terminal: Warp 0.2025.12.17.17.17.02

Configuration:
Custom Bedrock provider with 4 models configured in opencode.json:

{
  "provider": {
    "bedrock": {
      "npm": "@ai-sdk/amazon-bedrock",
      "name": "Amazon Bedrock",
      "options": { "region": "us-east-1" },
      "models": {
        "us.anthropic.claude-opus-4-5-20251101-v1:0": { "name": "Claude Opus 4.5 (Best)" },
        "us.anthropic.claude-sonnet-4-5-20250929-v1:0": { "name": "Claude Sonnet 4.5 (Balanced)" },
        "us.anthropic.claude-sonnet-4-20250514-v1:0": { "name": "Claude Sonnet 4 (Legacy)" },
        "us.anthropic.claude-haiku-4-5-20251001-v1:0": { "name": "Claude Haiku 4.5 (Fast)" }
      }
    }
  }
}

Behavior:

  • /models picker shows: Claude Opus 4.5, Claude Sonnet 4.5, Claude Sonnet 4 (and other built-in Bedrock models)
  • /models picker missing: Claude Haiku 4.5 (Fast) - my custom-named model
  • When searching "haiku" in /models, I see TWO entries in "Recent":
    • "Claude Haiku 4.5" (built-in from models.dev)
    • "Claude Haiku 4.5 (Fast)" (my custom config)

Observations:

  • The model works perfectly when selected via search
  • All 4 models work via AWS CLI
  • The custom model just doesn't render in the main provider list

This appears to be an incomplete fix - custom models with names similar to built-in models may be getting filtered/hidden incorrectly.

@chindris-mihai-alexandru commented on GitHub (Dec 30, 2025): This issue still persists in **v1.0.218**. **My setup:** - OpenCode version: 1.0.218 - OS: macOS 15.7.4 (Build 24G503) - Terminal: Warp 0.2025.12.17.17.17.02 **Configuration:** Custom Bedrock provider with 4 models configured in `opencode.json`: ```json { "provider": { "bedrock": { "npm": "@ai-sdk/amazon-bedrock", "name": "Amazon Bedrock", "options": { "region": "us-east-1" }, "models": { "us.anthropic.claude-opus-4-5-20251101-v1:0": { "name": "Claude Opus 4.5 (Best)" }, "us.anthropic.claude-sonnet-4-5-20250929-v1:0": { "name": "Claude Sonnet 4.5 (Balanced)" }, "us.anthropic.claude-sonnet-4-20250514-v1:0": { "name": "Claude Sonnet 4 (Legacy)" }, "us.anthropic.claude-haiku-4-5-20251001-v1:0": { "name": "Claude Haiku 4.5 (Fast)" } } } } } ``` **Behavior:** - `/models` picker shows: Claude Opus 4.5, Claude Sonnet 4.5, Claude Sonnet 4 (and other built-in Bedrock models) - `/models` picker **missing**: Claude Haiku 4.5 (Fast) - my custom-named model - When searching "haiku" in `/models`, I see TWO entries in "Recent": - "Claude Haiku 4.5" (built-in from models.dev) - "Claude Haiku 4.5 (Fast)" (my custom config) **Observations:** - The model works perfectly when selected via search - All 4 models work via AWS CLI - The custom model just doesn't render in the main provider list This appears to be an incomplete fix - custom models with names similar to built-in models may be getting filtered/hidden incorrectly.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3869