Skip to content

[BUG]: One malformed model field drops the whole provider from providers, with only a log warning #54973

Closed as duplicate

Description

@sergiopadure

Description

In a V2 config, if one model inside a providers entry has a malformed field, the whole provider is skipped. Every model of that provider disappears, and agents pinned to any of them stop resolving. The only signal is a WARN line in the server log, with the path of the provider, not of the bad field:

level=WARN message="configuration normalization diagnostic" source=.../opencode.json path=$.providers.example kind=invalid action="skipped malformed recognized value"

opencode debug config shows the provider as missing, and the TUI and opencode run give no warning.

The field that triggered it for us was variants written as an object (the V1 shape, still accepted under the legacy provider key) instead of the V2 array of { id, settings }. It is easy to write when you edit an existing config that mixes both keys.

Steps to reproduce

  1. Create opencode.json in an empty directory:
{
  "$schema": "https://opencode.ai/config.json",
  "providers": {
    "example": {
      "name": "Example",
      "package": "@opencode/ai/providers/openai-compatible",
      "settings": { "baseURL": "http://127.0.0.1:9/v1" },
      "models": {
        "m1": { "name": "M1", "variants": { "high": { "reasoningEffort": "high" } } }
      }
    }
  }
}
  1. Run opencode debug config in that directory: the document shows "providers": {}.
  2. Change variants to [{ "id": "high", "settings": { "reasoningEffort": "high" } }]: the provider and its model appear.

Expected

Any of these would have saved us the outage:

  • Skip only the malformed field or model, not the whole provider.
  • Report the full path of the bad field ($.providers.example.models.m1.variants).
  • Show configuration diagnostics where users look: opencode debug config output and a TUI or CLI warning at startup or reload.

Version

OpenCode 2.0.27, Linux.

Activity

  1. opencode-agent commented on Oct 12, 2026

    @opencode-agent
    Contributor

    Thanks for the clear, minimal reproduction, @sergiopadure. I think this is a duplicate of #53744. In that thread we reproduced the same thing: variants written in the object shape inside a V2 providers model makes the whole provider disappear, and the only sign is a log warning at $.providers.<id> that doesn't mention variants.

    Possible duplicates and closely related issues, ordered from most to least likely:

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different. Your points about skipping only the bad model or field, and about showing these warnings in opencode debug config and the TUI, are welcome as comments on #50340 and #54786.

  2. opencode-agent commented on Oct 13, 2026

    @opencode-agent
    Contributor

    We haven't heard back, so I'm closing this as a duplicate of #53744. That issue covers the same problem: variants written as an object in a V2 providers model drops the whole provider, and the only sign is a warning at $.providers.<id>.

    If you want to follow progress or add your points about skipping only the bad field, naming its full path and showing these warnings in the CLI or TUI, these are the places:

    If your case is actually different, reply here and we'll take another look. Thanks for the clear report.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions