You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Model variants supplied by plugins are clobbered by late config transform #59836
After upgrading to v2.2.0, models whose reasoning tiers are supplied by an earlier model transform (e.g. a spec-pack plugin) lose their custom tiers on any location that has not been opened before. Fresh locations show generic Default/Low/Medium/High instead of the plugin's verified tiers (e.g. none/low/medium/xhigh).
Root cause
In packages/core/src/config/plugin/provider.ts, the late config transform re-resolves model.variants with the default effort list ["low","medium","high"] whenever a configured model has neither config.variants nor config.capabilities.reasoning. This overwrites variants already populated by an earlier transform (plugin), because the guard only checks source?.base / repackaged, not whether the model already carries variants.
Steps to reproduce
Configure a provider whose models get custom variants from a plugin transform (no variants/capabilities.reasoning in opencode.json).
Open a directory that has never been opened before (no cached catalog).
Observe the model picker shows Default/Low/Medium/High instead of the plugin's tiers.
Thanks for the detailed report. I reproduced this on 2.2.0, and it still happens on the latest dev (fa1260d).
Setup:
A project-local plugin uses ctx.model.transform to set variants none/low/medium/xhigh (and a marker family) on a config-defined model, myprov/my-model.
opencode.json lists that model with no variants and no capabilities.reasoning.
Result: model.list shows the plugin's family, so the plugin transform ran, but the variants are the generic low/medium/high. The late transform in packages/core/src/config/plugin/provider.ts re-resolves variants for custom models even when an earlier transform has already set them. When I skipped that step for models that already have variants, the plugin's tiers were kept. Your PR #59835 takes that approach.
One difference from your report: each of my runs used a brand-new data directory and project, so I couldn't check whether locations opened before behave differently.
The script below reproduces it. Run it with opencode from PATH, or with OC_DEV=<checkout> to run from source.
Activity
opencodejr commentedon Oct 28, 2026
Thanks for the detailed report. I reproduced this on 2.2.0, and it still happens on the latest
dev(fa1260d).Setup:
ctx.model.transformto set variantsnone/low/medium/xhigh(and a markerfamily) on a config-defined model,myprov/my-model.opencode.jsonlists that model with novariantsand nocapabilities.reasoning.Result:
model.listshows the plugin'sfamily, so the plugin transform ran, but the variants are the genericlow/medium/high. The late transform inpackages/core/src/config/plugin/provider.tsre-resolves variants for custom models even when an earlier transform has already set them. When I skipped that step for models that already have variants, the plugin's tiers were kept. Your PR #59835 takes that approach.One difference from your report: each of my runs used a brand-new data directory and project, so I couldn't check whether locations opened before behave differently.
The script below reproduces it. Run it with
opencodefrom PATH, or withOC_DEV=<checkout>to run from source.Reproduction script (repro.sh)
Run it:
bash repro.sh