Repository navigation
Releases: yuhp/opencode-models-discovery
Release list
v2.1.1
v2.1.0
🎉 Release v2.1.0
Changes since v2.0.1.
Documentation
Maintenance
- Merge pull request #175 from yuhp/release/v2.1.0 (ba0d440)
- Merge pull request #174 from yuhp/feat/issue-162-ollama-model-info (2d50b49)
- feat(ollama): enrich model metadata from /api/show (2b37201)
- refactor(enrichment): add deferred prepare hook for model enrichers (00a0a34)
Installation
npm install opencode-models-discovery@2.1.0
# or
bun add opencode-models-discovery@2.1.0v2.0.1
🎉 Release v2.0.1
Changes since v2.0.0.
Documentation
- docs: document llama-swap effective context resolution (96fa3b8)
- docs: update OpenCode compatibility badge links (6d440d8)
- docs: correct openai-compatible provider package name to @opencode/ai (refs #165) (4bad300)
Maintenance
- Merge pull request #173 from yuhp/release/v2.0.1 (f7f7408)
- Merge pull request #172 from TychoTheTaco/fix/llama-swap-effective-context (94ab6e1)
- fix(llama-swap): resolve effective context as the smallest inline declaration (5a60b75)
- Merge pull request #167 from yuhp/dependabot/npm_and_yarn/opencode/plugin-2.0.32 (e1480c0)
- build(deps): sync bun lockfile for opencode plugin 2.0.32 (91e1228)
- Merge pull request #171 from yuhp/dependabot/npm_and_yarn/opencode-ai/plugin-1.19.3 (b328ef0)
- Merge pull request #170 from yuhp/dependabot/npm_and_yarn/eslint-10.13.0 (38302e3)
- Merge pull request #169 from yuhp/dependabot/npm_and_yarn/typescript-eslint-8.71.2 (3b48fc2)
- Merge pull request #168 from yuhp/dependabot/npm_and_yarn/vitest/coverage-v8-5.0.5 (ca0014d)
- Merge pull request #166 from yuhp/dependabot/github_actions/hashgraph-online/ai-plugin-scanner-action-1.2.792 (c6e075f)
- build(deps-dev): bump @opencode-ai/plugin from 1.19.0 to 1.19.3 (1f5bd34)
- build(deps-dev): bump eslint from 10.12.0 to 10.13.0 (6e43937)
- build(deps-dev): bump typescript-eslint from 8.71.1 to 8.71.2 (822cd59)
- build(deps-dev): bump @vitest/coverage-v8 from 5.0.3 to 5.0.5 (539be0e)
- build(deps): bump @opencode/plugin from 2.0.26 to 2.0.32 (4138491)
- build(deps): bump hashgraph-online/ai-plugin-scanner-action (39191ae)
Installation
npm install opencode-models-discovery@2.0.1
# or
bun add opencode-models-discovery@2.0.1v2.0.0
v2.0.0
Stable OpenCode v2 support
opencode-models-discovery@2.0.0 promotes OpenCode v2 to the primary, stable integration. V2 uses the native plugins / providers configuration shape, the provider lifecycle API, host-managed storage, Integration credentials, the native TUI, RPC handlers, and Agent Tools.
Highlights
Model Metadata Enrichment
V2.0.0 officially documents and supports nine model info metadata formats, decoupling provider metadata ingestion from core discovery scheduling:
- OpenRouter (
"openrouter"): Reads OpenRouter's inline/v1/modelsmetadata without making a secondary request. Maps context length, top provider output limits, architecture modalities (text,image,audio, etc.), prompt/completion and cache pricing, tool-calling flags, and reasoning effort variants (low,medium,high, etc.). - AIProxy (
"aiproxy"): Composes AIProxy inline limits, pricing, and effort tiers with models.dev display names and metadata. - Bifrost AI Gateway (
"bifrost"): Reads inline limits, modalities, per-token pricing, and reasoning variants. - LiteLLM (
"litellm"): Requests/v1/model/infoto ingest rich model metadata, context limits, pricing, and capabilities. - LM Studio (
"lmstudio"): Enriches/v1/modelswith loaded instance configurations from LM Studio 0.4.0+'s native/api/v1/modelsendpoint. - llama-swap (
"llama-swap"): Inline discovery of context lengths, architectures, and function-calling flags. - models.dev (
"models.dev"): Public catalog lookup for general context limits and capabilities. - OmniRoute (
"omniroute"): Inline metadata mapping for limits, multimodal capabilities, and service-tier variants (fast,flex). - vLLM (
"vllm"): Inline extraction of numericmax_model_lenlimits without secondary requests.
OpenCode v2 Integration Credentials
OpenCode v2 providers can manage credentials interactively using OpenCode's native /connect workflow through the host Integration API. When configured via /connect, API keys do not need to be written into opencode.json or opencode.jsonc.
V2 Model Overrides
V2 model overrides are persisted in host storage under:
overrides:<providerID>:<modelID>
Overrides can be listed, edited, enabled, disabled, and deleted through the V2 RPC contract and the /models-discovery-console model interaction. The model list marks overridden models with *. Cache clearing does not delete overrides.
Supported fields include display name, limits, capabilities, reasoning, attachments, variants, cost, and compatibility metadata. Credential and authorization fields are rejected and are never persisted.
Configuration
OpenCode v2 configuration uses opencode.jsonc (or opencode.json) with the primary path:
providers.<provider-id>.settings.modelsDiscovery
Example:
{
"$schema": "https://opencode.ai/config.json",
"plugins": [
"opencode-models-discovery@2.0.0"
],
"providers": {
"gateway": {
"package": "@opencode-ai/ai/providers/openai-compatible",
"name": "My Gateway",
"settings": {
"baseURL": "https://gateway.example.com/v1",
// Optional: omit if managing credentials interactively via OpenCode '/connect'
"apiKey": "example_api_key",
"modelsDiscovery": {
"enabled": true,
"cache": { "enabled": true, "ttlSeconds": 86400 }
}
}
}
}
}Use /connect or a host environment substitution ({env:KEY}) for credentials. V2 does not read V1 auth.json or OPENCODE_AUTH_CONTENT fallback data.
TUI and Agent Tools
Available V2 commands and tools include:
/models-discovery-refresh
/models-discovery-console
models_discovery_refresh
models_discovery_status
The console supports interactive model browsing, metadata inspection, cache operations, and model override editing. Override changes reload the provider and refresh the current TUI model list without restarting the service.
OpenCode v1 Legacy Support
The OpenCode v1 adapter remains available through the combined package entrypoint. Existing V1 configuration, provider-level discovery settings, XDG cache, auth fallback, and helper commands remain supported for compatibility, security fixes, and severe regressions.
New lifecycle, cache, TUI, RPC, and model override features target OpenCode v2 first and are not automatically backported to V1.
Migration
V1 users can continue using the legacy adapter. Users moving to OpenCode v2 should follow Migrating Configuration from OpenCode v1 to OpenCode v2.
V1 XDG cache files are not imported into V2. V2 cache and override storage are host-managed and use separate namespaces.
Validation
This release is validated by the repository's V1/V2 unit and contract tests (41 test files, 314 tests), local OpenAI-compatible HTTP integration tests, compiled package validation checks, and Node package-loadability dry-run tests.
v2.0.0-rc.2
🎉 Release v2.0.0-rc.2
⚠️ OpenCode v2 Configuration Notice:
While in Release Candidate testing, use"opencode-models-discovery@rc"or pin to"opencode-models-discovery@2.0.0-rc.2"in youropencode.json. The final2.0.0package tag will be published to npm upon stable release.
Changes since v2.0.0-rc.1.
Maintenance
- Merge pull request #154 from yuhp/release/v2.0.0-rc.2 (d7ace6a)
- fix(litellm): bound output limit and disambiguate max_tokens fallback (6d3b7db)
- fix(vllm): bound output limit instead of reserving whole context window (ff95e33)
- fix(vllm): bound output limit instead of reserving whole context window (ad91766)
- Chore/rc2 opencode plugin 2.0.26 (#152) (408bd1d)
- build(deps-dev): bump @opencode-ai/plugin from 1.18.32 to 1.19.0 (#147) (6d0a18b)
- build(deps-dev): bump @types/node from 26.6.3 to 26.6.5 (#146) (e637631)
- build(deps): bump hashgraph-online/ai-plugin-scanner-action (#151) (762885b)
- build(deps-dev): bump typescript-eslint from 8.71.0 to 8.71.1 (#150) (7b5e9e7)
- build(deps): bump actions/setup-node from 7.0.0 to 7.1.0 (#149) (ea42a67)
- test: use placeholder prefixes for mock api keys to satisfy security scanner (4df9030)
- merge: sync main release into dev (40194b6)
OpenCode v2 Configuration
Add to your opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugins": [
"opencode-models-discovery@rc"
]
}(You can also pin directly to "opencode-models-discovery@2.0.0-rc.2").
Manual CLI Installation
npm install opencode-models-discovery@2.0.0-rc.2
# or
bun add opencode-models-discovery@2.0.0-rc.2v2.0.0-rc.1
🎉 Release v2.0.0-rc.1
⚠️ OpenCode v2 Configuration Notice:
While in Release Candidate testing, use"opencode-models-discovery@rc"or pin to"opencode-models-discovery@2.0.0-rc.2"(recommended) in youropencode.json. The final2.0.0package tag will be published to npm upon stable release.
Changes since v1.10.0.
Features
- feat: add persistent model overrides (55e636f)
Documentation
- docs: promote v2 integration to stable (3b41616)
- docs: finalize v1 legacy support policy (2219d59)
- docs: plan v2.0.0 implementation (2f7a315)
Maintenance
- Merge pull request #145 from yuhp/release/v2.0.0-rc.1 (4272248)
- Merge pull request #144 from yuhp/feat/v2.0.0-support (e1ae6b4)
- release: finalize v2 ci and github actions publishing (7c1b6e0)
- test: define v1 legacy adapter boundary (f999792)
- test: add local v2 integration coverage (cca426c)
- test: cover v2 cache and override lifecycles (b8ddf29)
- test: harden v2 lifecycle behavior (4fcb883)
OpenCode v2 Configuration
Add to your opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugins": [
"opencode-models-discovery@rc"
]
}Manual CLI Installation
npm install opencode-models-discovery@2.0.0-rc.1
# or
bun add opencode-models-discovery@2.0.0-rc.1v1.10.0
Release v1.10.0
v1.10.0 strengthens the OpenCode v2 integration with native Integration
credentials, hidden API key handling, interactive model inspection, and
host-managed discovery cache operations. OpenCode v1 behavior and
configuration remain compatible.
Highlights
OpenCode v2 Integration Credentials
OpenCode v2 providers can now use credentials managed by the native /connect
workflow through the host Integration API. API keys do not need to be written
into opencode.json.
{
"providers": {
"deepseek-custom": {
"name": "DeepSeek Custom",
"package": "@opencode-ai/ai/providers/openai-compatible",
"settings": {
"baseURL": "https://api.deepseek.com",
"modelsDiscovery": {
"enabled": true,
"endpoint": "/models"
}
}
}
}
}After configuring the provider:
- Run
/connectin the OpenCode v2 TUI. - Select the provider.
- Enter the API key.
- Model discovery uses the managed credential.
- Runtime model requests use the same Integration-backed credential.
Providers can optionally reuse a credential from another Integration by
setting settings.integrationID.
Hidden API Key Handling
Integration credentials are resolved only when needed for discovery and runtime
requests. Resolved API keys are:
- not written back to
opencode.json; - not stored in discovery cache records;
- not returned by status tools or TUI diagnostics;
- not included in logs; and
- injected into runtime request headers only in memory.
When a credential is disconnected or revoked, the adapter reacts to the host
credential event and removes the in-memory authorization binding.
Unified Discovery Console
The new native TUI command is:
/models-discovery-console
It combines interactive model inspection with discovery cache management. The
standalone quick-refresh command remains available:
/models-discovery-refresh
The console provides:
- Provider → Model → Details browsing;
- Provider and model metadata inspection;
- Cache status inspection;
- Force refresh while bypassing valid cache entries;
- Provider cache clearing; and
- Clearing all discovery caches.
A Provider filter is supported:
/models-discovery-console status --provider <provider-id>
Added
Integration-Aware Credential Resolution
The V2 adapter resolves provider credentials with the following precedence:
- Explicit
providers.<id>.settings.apiKey; - An active Integration credential referenced by
settings.integrationID; - The provider's default Integration credential; and
- Unauthenticated access for providers that do not require credentials.
Credential Lifecycle Reactivity
The plugin reacts to OpenCode v2 credential and configuration lifecycle events,
including credential updates, credential switching, Integration updates, and
configuration updates. Discovery and runtime authentication can therefore be
refreshed without restarting OpenCode.
Structured Discovery Status
The models_discovery_status Agent Tool and native TUI console expose
structured Provider and model information, including:
- Provider identity;
- Model counts;
- Model metadata;
- Limits;
- Capabilities;
- Variants; and
- Cache state.
Credentials and authorization headers are excluded from these responses.
Changed
Improved Model Detail Presentation
Model details are shown in structured sections instead of a single
unformatted report. Limits, capabilities, modalities, reasoning support,
attachments, and variants are easier to inspect.
Improved Provider Model Counts
Provider summaries now report the resolved model count directly, including
providers with zero available models.
Workspace-Aware RPC Routing
Discovery status, refresh, and cache operations use the active OpenCode
workspace location, improving behavior in multi-workspace sessions.
Compatibility
- Existing OpenCode v1 configuration and discovery behavior remain supported.
- Existing V1 cache behavior remains unchanged.
- OpenCode v2 continues to use the
plugins,providers,package, and
settingsconfiguration model. - V1 and V2 use separate cache formats.
- Explicit
settings.apiKeyconfiguration remains supported. - OpenCode v2 Integration credentials require a compatible OpenCode v2 host.
- OpenCode v2 discovery and cache operations remain beta features.
- The
models_discovery_refreshandmodels_discovery_statusAgent Tools
remain available for automation.
Deferred
Model-level overrides remain deferred for a future release. This includes:
- Custom model renaming;
- Model disabling;
- Manual limit overrides;
- Manual capability overrides; and
- Provider-specific model metadata corrections.
v1.9.0
Release v1.9.0
v1.9.0 strengthens the shared V1/V2 discovery core and adds provider-scoped host-managed caching for OpenCode v2, while preserving the existing OpenCode v1 configuration and cache behavior.
Added
OpenCode v2 Host-Managed Discovery Cache
OpenCode v2 providers can opt into discovery caching through the host-provided storage API:
{
"modelsDiscovery": {
"enabled": true,
"cache": {
"enabled": true,
"ttlSeconds": 86400
}
}
}The V2 cache stores raw provider models and enrichment results. Fresh cache entries are reprocessed through the shared discovery pipeline so current filtering, classification, naming, and mapping rules remain effective. Caching is disabled by default.
The models_discovery_status tool can inspect cached data with:
{
"details": true,
"rawCache": true
}V2 uses a separate host-managed cache and does not import the V1 XDG disk-cache format. V2 cache-associated model overrides and /models-discovery:config cache management remain deferred.
Shared Discovery And Projection Core
The shared core now provides consistent behavior across OpenCode v1 and v2 for:
- raw model validation and normalization;
- model filtering and classification;
- smart naming and duplicate-name disambiguation;
- model-info enricher resolution;
- limit normalization and safe context-only output defaults;
- V1/V2 model projection parity.
V1 cache hits with raw model data are reprocessed through the shared pipeline, keeping cached and freshly discovered models consistent when filters, naming, or enrichment settings change.
Provider Metadata Improvements
- Bifrost reasoning efforts are exposed as standard
reasoningEffortvariants. - Bifrost context-only model limits are preserved.
- OmniRoute context-only limits and service-tier variants are supported.
- Reasoning capabilities are no longer guessed from model IDs.
Changed
Discovery Status
models_discovery_status now reports provider model details, context/output limits, capabilities, cache status, and optionally raw cached models and enrichment results.
Documentation
- docs: align V2 cache and validation guidance (2760727)
- docs: document V2 discovery cache (85383ee)
- docs: explain AIProxy metadata discovery (12aa2f5)
Maintenance
- Merge pull request #114 from dkattan/fix/bifrost-reasoning-variants-and-context-limit (9b9c492)
- fix(bifrost): map reasoning efforts to variants and emit context-only limits (1925331)
- Merge pull request #130 from Avinash99b/prob-omniroute-context-injection (ed657de)
- feat(omniroute): preserve context limit without output tokens and discover service tier variants (7864a83)
- Merge pull request #138 from yuhp/refactor/phase5-shared-contract-fixes (4cd850e)
- docs(prd): record removal of heuristic reasoning guessing in Phase 5 (d46e958)
- fix(core): remove heuristic name-based reasoning guessing (02e15d1)
- test(core): add end-to-end V1/V2 adapter parity tests and finalize Phase 5 PRD (ab6707d)
- refactor(core): share model-info enricher resolution across V1 and V2 (99aee65)
- feat(v2): enhance models_discovery_status with limits and cache inspection (6782d89)
- refactor(cache): isolate V2 storage backend from cache policy (097632c)
- feat(v2): persist discovery cache through host storage (ed8e1cd)
- fix(v1): reprocess cached models through shared discovery pipeline (a7fde6c)
- refactor(core): share model projections across V1 and V2 (94813ed)
- Revert "refactor(v1): extract shared draft model mapper" (0c28655)
- refactor(v1): extract shared draft model mapper (dd767e1)
- refactor(core): enforce strict NormalizedModelLimit and remove loose index signature (99159df)
- refactor(core): unify model validity, owner resolution, and safe limit fallback semantics (d7dfc40)
- Merge pull request #137 from yuhp/refactor/shared-runtime-bundle (4c32a6c)
- refactor: share runtime bundle across plugin entries (defeff4)
- merge: integrate v2 shared-core refactor into dev (420b98a)
- chore: silence logger console lint warnings (295c340)
- refactor: remove legacy model enricher compatibility (9a63e58)
- refactor: simplify v2 model mapper inputs (a414f84)
- refactor: map native model enrichers (1ef0916)
- merge: integrate AIProxy metadata discovery into v2 (b24f06c)
- Merge pull request #129 from github-nicolas-stadler/feat/aiproxy-metadata-enrichment (3545a60)
- chore: ignore opencode config variants (e7098c0)
- refactor: migrate built-in model enrichers (a802c6a)
- chore: ignore OpenCode worktrees (ab9f83d)
- refactor: verify shared core parity (12e5ccc)
- refactor: extract shared discovery pipeline (dc40e1f)
- refactor: add shared model enrichment contract (fe96f3f)
- refactor: add shared model filtering and naming core (80e8357)
- Merge remote-tracking branch 'origin/main' into dev (de48d06)
v1.8.0
Release v1.8.0
v1.8.0 improves OpenCode v2 model discovery with a user-facing manual refresh command and a shared, serialized refresh flow for startup, configuration changes, agent tools, and command execution.
Added
Manual V2 Refresh Command
The OpenCode v2 adapter now registers the following Server Command:
/models-discovery-refresh
The command refreshes models from the current provider configuration and reports the result in the active session. It uses the same refresh operation as the existing models_discovery_refresh agent tool.
Refresh Feedback
Refresh results now use a consistent format:
Model discovery refreshed: discovered 12 models from 2 providers.
Failures return a safe user-facing message without exposing credentials or authorization details.
Changed
Unified V2 Refresh Flow
V2 refresh operations now:
- reload the current OpenCode provider registry before discovery;
- rebuild provider configuration and discovery options from the current registry;
- serialize startup retries, configuration updates, agent-tool refreshes, and manual command refreshes through one operation queue;
- keep integration and provider transforms registered once during plugin setup;
- preserve full inventory replacement semantics after each discovery attempt.
This makes manual refresh and config.updated use the same path and ensures changes to provider endpoints, filters, enablement, or credentials are reflected consistently.
V2 Documentation
The V2 documentation now describes the manual refresh command, its relationship to the existing agent tools, and the current session-based feedback behavior.
Development and Security Tooling
This release also includes routine updates to development dependencies and the plugin security scanner action.
Removed Legacy Combined E2E Test
The old combined V1/V2 end-to-end test was removed because it depended on machine-specific OpenCode paths and a live provider endpoint. The regular unit/integration test suite and the local provider probe remain available for validation.
Compatibility
- Existing OpenCode v1 configurations remain supported.
- Existing OpenAI-compatible and Anthropic-compatible V2 discovery behavior remains supported.
- OpenCode v2 discovery remains beta and requires a V2 host with the V2 plugin API.
- The V2 manual refresh command does not modify
opencode.jsonor manage credentials.
v1.7.1
🎉 Release v1.7.1
Changes since v1.7.0.
Features
- feat: disambiguate colliding smart model names (47d4e37)
Maintenance
- Merge pull request #127 from yuhp/release/v1.7.1 (5317b90)
- fix(v2): honor explicit discovery enablement (9b7bb76)
- Merge pull request #126 from yuhp/feat/issue-118-smart-model-name-conflicts (0caa7ad)
- Merge origin/main into dev (b1b337c)
Installation
npm install opencode-models-discovery@1.7.1
# or
bun add opencode-models-discovery@1.7.1