Repository navigation
Description
Bug Description
After running opencode models --refresh, custom providers declared in opencode.json disappear from the /models TUI picker catalog. The models still appear in the Recent section (because they were used before), but they are no longer listed under their provider section.
This suggests that opencode models --refresh replaces the local model catalog (~/.cache/opencode/models.json) with the public models.dev snapshot, which does not include custom providers, and does not re-merge the custom provider definitions from config.
Steps to Reproduce
- Configure a custom provider in
~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"scnet": {
"npm": "@ai-sdk/openai-compatible",
"name": "SCNet",
"options": {
"baseURL": "https://api.scnet.cn/api/llm/v1",
"apiKey": "<redacted>"
},
"models": {
"Kimi-K2.7-Code": { "name": "Kimi-K2.7-Code" },
"MiniMax-M2.5": { "name": "MiniMax-M2.5" }
}
}
},
"model": "scnet/Kimi-K2.7-Code"
}- Open the OpenCode TUI and use
scnet/Kimi-K2.7-Codeonce. - Quit OpenCode.
- Run
opencode models --refresh. - Reopen the OpenCode TUI and run
/models.
Expected Behavior
scnet/Kimi-K2.7-Code and scnet/MiniMax-M2.5 should still appear in the /models picker under the scnet provider, alongside the refreshed public catalog.
Actual Behavior
- The
scnetprovider is not visible in the/modelscatalog. - The models do appear in the Recent section.
~/.cache/opencode/models.jsonno longer contains thescnetprovider.
Evidence
~/.local/state/opencode/model.json still contains the recent entries:
{
"recent": [
{"providerID": "scnet", "modelID": "Kimi-K2.7-Code"},
...
]
}~/.cache/opencode/models.json contains only public providers (e.g. deepseek, openai, etc.) and no scnet key.
Environment
- OpenCode version: 1.18.10
- OS: macOS
- Install method: Homebrew
Workaround
Avoid running opencode models --refresh, or manually select the model from the Recent section.
Related Issues
- /model TUI picker does not display all custom provider models (models load correctly but don't appear in UI) #6169
/model TUI picker does not display all custom provider models - The cache of the Provider‘s Models cannot be updatable #7714
The cache of the Provider's Models cannot be updatable - Regression: plugin provider.models() hook no longer populates custom providers (post #25167) #25630
Regression: plugin provider.models() hook no longer populates custom providers
Activity
github-actions commentedon Oct 6, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.