anomalyco / anomalyco/opencode

providers: custom provider silently skipped when model capabilities omit tools

Open
#49,912 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

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/configproviders 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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the configuration through /api/config and /api/model using the provider example, then inspect the provider capability normalization path and the migrate-v1 guide. Determine whether missing tools should use the documented default or be required by migration guidance; improve the diagnostic if possible. Done means the intended behavior is explicit and the provider is no longer silently absent without a useful explanation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.