opencode icon indicating copy to clipboard operation
opencode copied to clipboard

providers: models from local provider definitions are never listed (v2.1.4)

Open pskraemer11 opened this issue 1 month ago • 2 comments

v2.1.4: models from local provider definitions are never listed (server-side, not just the dialog)

Related: #50726 (dialog-only variant), #57161, #51031.

Summary

Models defined under providers.<id>.models in the global config never appear — neither in the desktop /models dialog nor in opencode-cli models. The list contains only models that come from connected sources (console-*), opencode and opencode-go. This affects every locally configured provider, including a documented one.

Environment

  • opencode v2.1.4 (desktop, bundled CLI at resources/opencode-cli.exe)
  • Windows 11 25H2, PowerShell 7
  • No plugins, no project-local config; global config only
  • OpenRouter and OpenAI are connected through the OpenCode Console

Reproduction

  1. Global ~/.config/opencode/opencode.jsonc:
{
  "providers": {
    "openai": {
      "settings": { "compaction": { "type": "native" } },
      "models": { "gpt-6-luna": {} }
    },
    "openrouter": {
      "models": {
        "anthropic/claude-haiku-5.5": {},
        "@preset/auto-router": { "modelID": "@preset/auto-router" }
      }
    },
    "probe": {
      "name": "Probe",
      "package": "@opencode/ai/providers/openai-compatible",
      "env": ["OPENROUTER_API_KEY"],
      "settings": { "baseURL": "https://openrouter.ai/api/v1" },
      "models": {
        "auto": { "modelID": "openrouter/auto", "name": "Auto Router",
                  "limit": { "context": 2000000, "output": 200000 } }
      }
    }
  }
}

  1. opencode-cli models --standalone (also without --standalone, against the running server).

Actual

opencode models --standalone | cut -d/ -f1 | sort | uniq -c
      2 console-anthropic
      5 console-lm-studio
      6 console-openai
     42 console-openrouter
     18 opencode
     30 opencode-go

Model counts per configured provider: openai/ 0, openrouter/ 0, probe/ 0. Total: 103 models, none from the config.

Expected

The models declared in providers.*.models are listed and selectable, as they are for console-* connections.

Why this matters

Without a working local provider block there is no way to send provider-specific request-body fields, because providers.<id>.models.<model>.body is the only documented place for them. Concretely, this blocks:

  • OpenRouter router plugins (plugins: [{ "id": "auto-router", "cost_tier": "low" }])
  • OpenRouter provider routing (provider: { "sort": "price", "quantizations": [...] })
  • service_tier: "flex"
  • any model id that the Console catalog does not know (for example @preset/<slug> references, which OpenRouter accepts as model ids)

A preset workaround exists only for provider fields (OpenRouter persists model, provider, temperature, top_p, system, tools in a preset), not for router plugins.

Notes

  • The same symptom was reported for a custom OpenAI-compatible provider in #50726 (v2.0.14), where the server did serve the models and only the dialog hid them. Here the models are missing server-side as well, so this may be a second defect.
  • Values in settings (baseURL, apiKey) made no difference; package + env made no difference.

pskraemer11 avatar Oct 26 '26 08:10 pskraemer11

Thanks for the detailed report and the exact config, @pskraemer11.

I couldn't reproduce this on v2.1.4 without a Console connection. I used your global opencode.jsonc unchanged, with no plugins and no Console connection, and ran opencode models --standalone. All of your configured models were listed: openai/gpt-6-luna, openrouter/anthropic/claude-haiku-5.5, openrouter/@preset/auto-router and probe/auto.

The one difference from your setup is the OpenCode Console connection. When I added a provider.use policy that denies * and allows only opencode* and console-*, I got your result exactly: every provider from your config disappeared, and only the Console and OpenCode ones were left. A Console organization can send policies like this, and they override your own config (see #54382), so in that case the providers would be hidden on purpose rather than because of a bug.

Could you check these?

  1. Run opencode models --standalone once while signed out of the Console, or with a fresh profile, and check whether your configured models show up.
  2. Check whether your Console organization has any provider policies (for example deny * plus allow rules for console-* and opencode*), and share them with any private details removed.
  3. Check whether your own config has policies, enabled_providers or disabled_providers.

Related issues, most likely first:

  • #54382: Console organization provider.use policies remove providers you define yourself
  • #50726: custom provider models missing from the desktop /models dialog only
  • #53582: a config provider named like a catalog provider pulls in the whole catalog model list

opencode-agent[bot] avatar Oct 26 '26 08:10 opencode-agent[bot]

Closing this since we couldn't reproduce it with your config and haven't heard back. The same result appears when a Console organization's provider.use policy hides local providers (#54382). If it still happens on the latest version while signed out of the Console or with no provider policies, reply with that result and we'll reopen.

neriousy avatar Nov 19 '26 12:11 neriousy