-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
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 pickeraistudio/gemini-3-pro-preview- loads correctly, not in pickermyproxy/antigravity/claude-opus-4-5- loads correctly, not in picker
OpenCode version
1.0.201
Steps to reproduce
- Create a custom provider in
opencode.jsoncwith multiple models:
- Run
opencode modelsto verify all models are loaded correctly - Launch OpenCode TUI and type
/model - 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
/modeldialog
Workaround
You can still use missing models by:
- Setting them directly in config:
"model": "myproxy/model-name" - Using them once, then selecting from "Recent" section
Screenshot and/or share link
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
{ "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 } } } } } }