Skip to content

config: native providers block ignored in V2 2.0.16 #51252

Closed

Description

@alamaby

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

  1. 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"]
              }
            }
          }
        }
      }
    }
  2. Wait for provider discovery to settle.
  3. Request /api/provider and /api/model for the isolated location.
  4. Repeat with the equivalent V1 provider entry using npm, 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/config shows the native providers document, so the file is discovered.
  • The provider object shape matches the V2 configuration documentation and the published Config.ProviderEncoded OpenAPI schema.
  • The problem persists with both @opencode/ai/providers/openai-compatible and the migration-guide aisdk:@ai-sdk/openai-compatible package specifier.
  • A temporary workaround is to keep the native providers map and add the equivalent V1 provider map. V2 then loads the V1 definitions and preserves all custom models.
  • No private endpoints, credentials, or project data are included in this report.

Activity

  1. rekram1-node commented on Sep 25, 2026

    @rekram1-node
    Contributor

    we will fix

  2. jlongster commented on Sep 29, 2026

    @jlongster
    Contributor

    should be fixed in #51365, merging today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions