Skip to content

[FEATURE]: Expose configured model eligibility to model transforms #54480

Open

Description

@vmvarela

Feature hasn't been suggested before?

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

A plugin can register a ctx.model.transform that creates a model alias: a new catalog entry with a different id but the same underlying modelID (the execution target). For example, a transform could select the newest match for openai/gpt-*-sol and materialize it as openai/gpt-sol.

Observed in OpenCode v2.0.26 on macOS: after setting providers.openai.models.gpt-6.1-sol.disabled to true and reloading the config, openai/gpt-6.1-sol disappears from the catalog, but openai/gpt-sol remains and its metadata matches the hidden model rather than the next candidate, openai/gpt-6-sol.

The external transform runs before the built-in config transform applies disabled as enabled = false. The public model editor does not appear to expose that configured eligibility state earlier:
https://github.com/anomalyco/opencode/blob/v2.0.26/packages/core/src/config/plugin/provider.ts#L95-L148

Could the plugin API expose configured model eligibility to transforms before they materialize aliases, or otherwise provide a supported way to check whether an alias's execution target is disabled, while preserving config precedence?

Related but distinct: #49986, #44081, #51598.

Activity

  1. opencode-agent commented on Oct 11, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed write-up, @vmvarela!

    To restate the request: a plugin that creates model aliases with ctx.model.transform needs a supported way to tell whether a target model has been disabled in config, so that an alias like openai/gpt-sol can skip a disabled openai/gpt-6.1-sol and use the next candidate. Config precedence should still hold.

    I checked the current code and it matches what you found. The built-in config transform is registered after external model transforms on purpose, so that config wins. That same step is where disabled becomes enabled = false, so external transforms never see it. This is a gap in the plugin API, not a bug in your plugin. A few ways it could be closed:

    • a read-only view of configured overrides or eligibility on the model editor during transforms
    • a later transform or validation phase that runs after config overrides are applied
    • a built-in alias concept that picks its target only after eligibility is applied

    Maintainers will consider this. Related issues:

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