Repository navigation
Description
Summary
OpenCode V2 2.0.16 accepts the documented native providers configuration map, but provider discovery ignores those entries. The same custom provider definitions load when placed under the V1 provider map.
Environment
- opencode version:
opencode v2.0.16 - OS: Windows 11 Home, version
10.0.26200, x64 - Terminal:
xterm-256color - Shell:
C:\WINDOWS\system32\cmd.exe - Install/channel: local V2 binary
- Active plugins: none in the isolated reproduction
Reproduction
- Start V2 with an isolated config home containing a native provider:
{ "$schema": "https://opencode.ai/config.json", "providers": { "acme": { "package": "@opencode/ai/providers/openai-compatible", "settings": { "baseURL": "https://example.com/v1", "apiKey": "{env:ACME_API_KEY}" }, "models": { "demo": { "name": "Demo", "capabilities": { "input": ["text"], "output": ["text"] } } } } } } - Wait for provider discovery to settle.
- Request
/api/providerand/api/modelfor the isolated location. - Repeat with the equivalent V1
providerentry usingnpm,options, and V1 model fields.
Expected Behavior
The custom provider under the native providers map should appear in /api/provider, and its models should appear in /api/model.
Actual Behavior
The native provider is omitted. Only built-in providers are returned. The server log repeatedly reports configuration normalization diagnostic at $.providers.<id> with kind=invalid and action="skipped malformed recognized value".
The equivalent V1 provider entry loads successfully. In a larger control configuration, the V1 form loaded 4 custom providers and 54 custom models, while the native providers form loaded none of them.
Additional Context
- The issue is reproducible in a pure temporary home with no OpenChamber managed config and no plugins.
/api/configshows the nativeprovidersdocument, so the file is discovered.- The provider object shape matches the V2 configuration documentation and the published
Config.ProviderEncodedOpenAPI schema. - The problem persists with both
@opencode/ai/providers/openai-compatibleand the migration-guideaisdk:@ai-sdk/openai-compatiblepackage specifier. - A temporary workaround is to keep the native
providersmap and add the equivalent V1providermap. V2 then loads the V1 definitions and preserves all custom models. - No private endpoints, credentials, or project data are included in this report.
Activity
rekram1-node commentedon Sep 25, 2026
we will fix
jlongster commentedon Sep 29, 2026
should be fixed in #51365, merging today