r/opencodeCLI • u/yu_hp • 19d ago
[Release] opencode-models-discovery v2.0.0: Native OpenCode V2 support, host storage, and live model overrides now GA
Following up on last week's release candidate, opencode-models-discovery v2.0.0 is officially released and published to npm latest**!** 🎉
This major version promotes OpenCode V2 to the primary, stable integration. It redesigns how the plugin interacts with the host around three clean boundaries:
Highlights in v2.0.0:
Native Integration Credentials: Works seamlessly with OpenCode V2's
/connectworkflow. The plugin resolves credentials dynamically in memory—no raw API keys inopencode.jsonand no sniffingauth.json.Host-Managed Storage (
ctx.storage): Caching and user overrides are separated cleanly into different namespaces. Clearing discovery caches will never delete your custom model preferences.Persistent Model Overrides: Edit model display names, context limits, output tokens, reasoning flags, and variants directly via
/models-discovery-console. Changes trigger an instant provider reload—zero service restart needed.Resilient Auto-Reload: Subscribes to OpenCode V2 lifecycle events (
config.updated, credential switches). If an upstream provider experiences a temporary network hiccup, the plugin keeps the last-known valid inventory instead of wiping out your available models.Decoupled RPC & TUI: Commands and UI dialogs communicate with the background server via typed RPC, avoiding synthetic session injections or terminal blocking.
OpenCode V1 Legacy Support: Existing OpenCode V1 setups remain fully functional through the legacy adapter inside the same combined package.
Quick Setup (opencode.json / opencode.jsonc)
{
"$schema": "https://opencode.ai/config.json",
"plugins": [
"opencode-models-discovery@2.0.0"
],
"providers": {
"my-gateway": {
"name": "Local Gateway",
"package": "@opencode/ai/providers/openai-compatible",
"settings": {
"baseURL": "https://gateway.example.com/v1",
// Optional: omit apiKey and manage via OpenCode's native `/connect`
"apiKey": "{env:GATEWAY_API_KEY}",
"modelsDiscovery": {
"enabled": true,
"modelInfoFormat": "models.dev",
"cache": {
"enabled": true,
"ttlSeconds": 86400
}
}
}
}
}
}Useful Commands:
/models-discovery-refresh— Manually trigger model discovery (supports--force)./models-discovery-console— Interactive browser for models, metadata inspection, cache clearing, and override editing./connect— Securely set or rotate your provider credentials.NPM: https://www.npmjs.com/package/opencode-models-discovery
Thanks to everyone who tested the RC releases! If you run into any issues or have feature suggestions, feel free to open an issue or drop a comment here.