Skip to content

providers: custom provider silently skipped when model capabilities omit tools #49912

Closed

Description

@renjianguojinqianfan

Description

Custom providers migrated from V1 following the migrate-v1 guide are silently skipped when a model's capabilities omits tools. V1 models only have modalities (no tool_call), so a literal migration yields capabilities: {input, output} without tools — the whole provider is then dropped with only a terse normalization warning. /api/config shows "providers": {}, /api/model has none of its models.

Server log (one line per provider, no field detail):

level=WARN message="configuration normalization diagnostic" path=$.providers.acme kind=invalid action="skipped malformed recognized value" role=server

Either missing capabilities.tools should fall back to the documented default (models doc: unknown models assume tool support), or the migrate-v1 guide should state tools is required and what to use when V1 has no tool_call. At minimum the warning should name the offending field, not just the provider path.

Plugins

none

OpenCode version

v2.0.9 (channel latest)

Steps to reproduce

  1. Add a custom provider whose model capabilities has input/output but no tools:
{
  "providers": {
    "acme": {
      "package": "aisdk:@ai-sdk/openai-compatible",
      "settings": { "apiKey": "{env:ACME_API_KEY}", "baseURL": "https://llm.example.com/v1" },
      "models": {
        "coder": {
          "limit": { "context": 262144, "output": 32768 },
          "capabilities": { "input": ["text", "image"], "output": ["text"] }
        }
      }
    }
  }
}
  1. Start opencode (config hot-reloads).
  2. opencode api get /api/config → providers is {}; log shows the WARN above.
  3. Add "tools": true to capabilities → provider loads, models appear enabled in /api/model.

Screenshot and/or share link

n/a (config/API output above)

Operating System

Windows 10.0.22000

Terminal

WarpTerminal

Activity

  1. cestercian commented on Sep 19, 2026

    @cestercian
    Contributor

    Working on a fix so migrated V1 custom providers are not silently skipped when capabilities omit tools.

  2. McNopper commented on Sep 20, 2026

    @McNopper

    Still reproduces on v2.0.10 (Windows 11 26200, PowerShell 7), and the trigger is broader than a missing tools: any incomplete capabilities object drops the whole provider entry.

    In my case the V1 → V2 migration produced the mirror of your example — tool_call: true became capabilities: { "tools": true } with no input/output:

    "models": {
      "k3": {
        "name": "Kimi K3",
        "capabilities": { "tools": true },
        "limit": { "context": 1048576, "output": 131072 }
      }
    }

    → path=$.providers.<provider> kind=invalid action="skipped malformed recognized value", provider absent from /models, and a session pinned to it failed with Model unavailable: <provider>/k3. Completing it to { "tools": true, "input": ["text"], "output": ["text"] } makes the provider load immediately.

    Two additional data points:

    • Not limited to custom providers. A providers.ollama entry (recognized/built-in) with a models block using the same partial capabilities was skipped identically. Built-in Ollama discovery still supplied models, which masked the skipped config entry and made it much harder to spot.
    • The generic warning sends you down false trails. Because the message names only the provider path, I assumed the aisdk:@ai-sdk/openai-compatible form from the migrate-v1 guide was rejected (both failing entries happened to use it). After completing capabilities, I verified that aisdk:@ai-sdk/openai-compatible and @opencode/ai/providers/openai-compatible both load and both serve live requests — the package form was never the problem. Naming the offending field would have made that obvious.

    The models doc's fallback assumptions ("Tool support, text and image input, and text output" for non-catalog models) read as if a partial capabilities object should merge with those defaults rather than invalidate the entry.

  3. neriousy commented on Oct 20, 2026

    @neriousy
    Member

    Thanks for the report! Version 2.0.22 fixed custom providers being skipped when model capabilities omit tools, input, or output; omitted fields now inherit the model's defaults. Update with opencode upgrade or npm i -g @opencode/cli@latest (desktop: update the app). Please reopen or comment if this still happens on 2.0.22 or later.

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