Repository navigation
Description
Summary
V2 can only subtract from the model catalog (disabled: true per model). Anyone who wants a curated list must enumerate and disable everything else — 364 entries for a 7-model list here — and the allowlist silently rots as new catalog models appear enabled by default. At the same time, OpenRouter presets (@preset/<slug>) have no first-class representation: the only working spelling is an undocumented body: { preset } merge, which is silently ignored when the request model differs from the model the preset resolves to.
Environment
- opencode version: 2.3.1
- OS: Microsoft Windows NT 10.0.26200.0 (win32 x64)
- Terminal: OpenCode Desktop (Electron)
- Shell: C:\WINDOWS\system32\cmd.exe (PowerShell 7.7.0 host)
- Install/channel: desktop install, latest
- Active plugins: none
Reproduction
-
Connect the
openrouterprovider.opencode modelsreports 371 models (359 openrouter + 12 opencode). -
Want a 7-model list: 4 OpenRouter presets plus 3 plain models.
-
Attach a preset the only way config permits today:
"providers": { "openrouter": { "models": { "z-ai/glm-5.3-flash": { "body": { "preset": "@preset/glm-5-3-flash-coding-test" } } } } }
-
Disable the other 364 models one by one. The resulting
opencode.jsoncis 29 KB. -
Add a model to the catalog upstream (or connect another provider) and it comes back enabled, because absence from config means enabled.
Expected Behavior
-
A way to declare the models I offer, rather than the models I refuse:
"providers": { "openrouter": { "allow": ["deepseek/deepseek-v4.1-flash-1017", "z-ai/glm-5.2", "z-ai/glm-5.3", "z-ai/glm-5.3-flash"] } }
Unlisted models would be hidden on the same paths
disabled: truealready hides them. New catalog models would appear only when explicitly allowed. -
OpenRouter presets as first-class model entries, one per preset, picker label included, with catalog metadata inherited from the model the preset resolves to:
"providers": { "openrouter": { "presets": { "deepseek-flash": { "preset": "@preset/deep-seek-v4-1-flash-1017", "name": "DeepSeek V4.1 Flash" }, "glm-5-3-reason": { "preset": "@preset/glm-5-3-reasoning-test", "name": "GLM 5.3 Reasoning" } } } }
Selectable as
openrouter/deepseek-flash, with limit, cost, capabilities and reasoning variants inherited rather than guessed.
Actual Behavior
- Only
disabled: trueexists, so curation is a denylist of everything else. 364 entries, and every catalog addition silently widens the list of models we did not approve. body.presetworks but is undocumented for this purpose, is not validated (an unknown field is merged silently), and is defeated whenever the requestmodeldiffers from the preset's model, because OpenRouter shallow-merges request fields over preset fields and request wins. A preset with a fallback array therefore cannot be expressed this way at all.- Setting a preset alias instead (
"modelID": "@preset/<slug>") makes the preset authoritative but throws away catalog metadata: OpenCode then assumes 200k context / 32k output / unknown cost, so the picker and spend estimates are wrong for the model actually being used. openrouter/@preset/<slug>as a model reference is rejected (requiresopenrouter/<catalog-key>), which is the original ask in [feature request] support openrouter presets #1439.
Additional Context
- Presets matter commercially here: pinning provider routing through a preset raised cache-hit rate enough to cut cost by roughly 10% versus calling the same model directly, so teams want every session, subagent and command to go through a preset named in configuration.
- Presets are workspace-scoped on the OpenRouter side, so a committed
opencode.jsonreferencing@preset/...is the natural way to give every dev identical routing — provided the key can't silently fall back to a non-preset path. - Workaround in use: a generator script emits the 364
disabledentries plus the fourbody.presetentries, and rewrites the config from a curated source list. It works, verified byopencode modelsreturning exactly 7 and preset turns resolving, but it is 29 KB of generated config standing in for one config key. - Related: catalog metadata in
opencode modelsonly lists what the config leaves enabled, so after the denylist is applied the CLI can no longer report the full catalog. That makes any regeneration script depend on a cached copy of the catalog to avoid quietly re-enabling everything on its second run.
Activity
opencodejr commentedon Nov 18, 2026
Thanks for the detailed write-up and the numbers behind it. You're asking for two things:
Maintainers will consider it.
What you describe matches the current docs. In V2 a model is hidden with
disabled: trueon that model (providers docs). V2 ignores the V1whitelist/blacklistfields (migration guide). A model that isn't in the catalog falls back to a 200,000-token context and 32,000-token output limit (models docs).Related issues, ordered by likelihood:
models["*"]: { "disabled": true }default. It was closed without being merged.enabled = falsethroughctx.model.transformhid models in that test.editor.remove()did not hide models that are listed in your config.model.use), the enforced-policy version of an allowlist.