Pre-flight Checklist
π Bug Description
Gentle-AI fails to discover OpenCode models (including MiniMax, Xiaomi, and other custom providers) when configuring models via gentle-ai install or the TUI. The model picker shows no available models, even though opencode providers list and the /models command in OpenCode correctly display all connected providers and their models.
π Steps to Reproduce
- Install and configure OpenCode with custom API providers (e.g., MiniMax, Xiaomi)
- Verify providers are connected: run
opencode providers list β shows all providers correctly
- Run
gentle-ai install or launch gentle-ai TUI
- Navigate to: Configure Models β Configure OpenCode models
- The model picker shows no available providers/models
β
Expected Behavior
Gentle-AI should discover and display all OpenCode models (including custom providers like MiniMax, Xiaomi) in the model configuration picker.
β Actual Behavior
- The OpenCode model picker shows: "OpenCode has not been run yet β model cache not found."
- No providers or models appear in the selection list
- However,
opencode providers list correctly shows all 4 providers: MiniMax Token Plan, Xiaomi, GitHub Copilot, MiniMax
Gentle AI Version
- Gentle AI Version: 1.43.3
Operating System
Windows (WSL)
AI Agent / Client
OpenCode
π Affected Area
Other
π‘ Logs / Error Output
**Gentle-AI detection output:**
Detected Configs
claude-code: present
opencode: present
kilocode: missing
gemini-cli: missing
cursor: missing
vscode-copilot: present
codex: missing
...
**OpenCode providers (working correctly):**
β Credentials ~/.local/share/opencode/auth.json
β
β MiniMax Token Plan (minimax.io) api
β Xiaomi api
β GitHub Copilot oauth
β MiniMax (minimax.io) api
β 4 credentials
**Gentle-AI model picker error:**
OpenCode has not been run yet β model cache not found.
Run 'opencode' once, then re-run 'gentle-ai sync' to assign models.
Using default model assignments for now.
Additional Context
Root Cause Analysis
Gentle-AI searches for OpenCode models in the old models.cache location:
~/.config/opencode/models.cache β File does not exist
However, OpenCode stores provider credentials and model information in:
~/.local/share/opencode/auth.json β Contains API keys and provider configs
~/.local/share/opencode/opencode.db β SQLite database with model data
File System Evidence
Existing gentle-ai search path (no models found):
~/.config/opencode/
βββ AGENTS.md
βββ opencode.json
βββ tui.json
βββ skills/
βββ profiles/
βββ node_modules/
βββ NO models.cache file exists
Actual OpenCode data locations (working):
~/.config/opencode/
βββ opencode.json β SDD orchestrator config only
βββ ...
~/.local/share/opencode/
βββ auth.json β API credentials (minimax, xiaomi, github-copilot)
βββ opencode.db β SQLite database with models/providers
βββ opencode.db-wal
βββ opencode.db-shm
βββ ...
Code Reference
The gentle-ai code in internal/tui/screens/model_picker.go loads models from:
providers, err := opencode.LoadModelsOrEmpty(cachePath)
Where cachePath appears to point to models.cache in ~/.config/opencode/, which no longer exists in current OpenCode versions.
Suggested Fix Direction
Gentle-AI should:
- Query the SQLite database
~/.local/share/opencode/opencode.db for available models, OR
- Detect that OpenCode uses the new data storage format and fall back to
opencode providers list CLI output, OR
- Support reading from
~/.local/share/opencode/ as an additional search path
Related: This also explains why Trae IDE models from subscriptions are not visible β the same model discovery mechanism would need to query Trae's own data storage.
Pre-flight Checklist
status:approvedπ Bug Description
Gentle-AI fails to discover OpenCode models (including MiniMax, Xiaomi, and other custom providers) when configuring models via
gentle-ai installor the TUI. The model picker shows no available models, even thoughopencode providers listand the/modelscommand in OpenCode correctly display all connected providers and their models.π Steps to Reproduce
opencode providers listβ shows all providers correctlygentle-ai installor launchgentle-aiTUIβ Expected Behavior
Gentle-AI should discover and display all OpenCode models (including custom providers like MiniMax, Xiaomi) in the model configuration picker.
β Actual Behavior
opencode providers listcorrectly shows all 4 providers: MiniMax Token Plan, Xiaomi, GitHub Copilot, MiniMaxGentle AI Version
Operating System
Windows (WSL)
AI Agent / Client
OpenCode
π Affected Area
Other
π‘ Logs / Error Output
Additional Context
Root Cause Analysis
Gentle-AI searches for OpenCode models in the old
models.cachelocation:However, OpenCode stores provider credentials and model information in:
File System Evidence
Existing gentle-ai search path (no models found):
Actual OpenCode data locations (working):
Code Reference
The gentle-ai code in
internal/tui/screens/model_picker.goloads models from:Where
cachePathappears to point tomodels.cachein~/.config/opencode/, which no longer exists in current OpenCode versions.Suggested Fix Direction
Gentle-AI should:
~/.local/share/opencode/opencode.dbfor available models, ORopencode providers listCLI output, OR~/.local/share/opencode/as an additional search pathRelated: This also explains why Trae IDE models from subscriptions are not visible β the same model discovery mechanism would need to query Trae's own data storage.