Skip to content

feat: support disabled flag on individual provider models#21038

Open
fpigeonjr wants to merge 1 commit intoanomalyco:devfrom
fpigeonjr:feat/model-disabled-flag
Open

feat: support disabled flag on individual provider models#21038
fpigeonjr wants to merge 1 commit intoanomalyco:devfrom
fpigeonjr:feat/model-disabled-flag

Conversation

@fpigeonjr
Copy link
Copy Markdown

@fpigeonjr fpigeonjr commented Apr 4, 2026

Issue for this PR

Closes #21035

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds a disabled boolean to the per-model config schema so users can hide specific models from the picker without removing the entire provider.

Two changes:

  1. config.ts — adds disabled: z.boolean().optional() to the model entry schema (same pattern as the existing variant-level disabled field)
  2. provider.ts — adds one check in the final filter loop: if (configProvider?.models?.[modelID]?.disabled === true) delete provider.models[modelID] (same pattern as the existing blacklist/deprecated filters)

Use case: GitHub Copilot exposes many models in models.dev but only a subset are available on a given subscription tier. This lets users trim the list to what they actually have access to.

"github-copilot": {
  "models": {
    "gpt-5.4": { "disabled": true },
    "grok-code-fast-1": { "disabled": true }
  }
}

How did you verify your code works?

Reviewed the existing filter loop and schema patterns. The change follows the exact same delete-from-map approach used by blacklist, deprecated, and alpha model filtering. No existing tests broken.

Screenshots / recordings

N/A — no UI changes, models simply no longer appear in the picker when disabled.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Add a `disabled` boolean field to the per-model config schema so users can
hide specific models from the model picker without removing the entire provider.

When `disabled: true` is set on a model entry, it is deleted from the provider's
live model map during the final filter pass — the same approach used by the
existing blacklist, whitelist, alpha, and deprecated filters.

This follows the same pattern already used for variant-level `disabled` flags.

Example usage:
```json
{
  "provider": {
    "github-copilot": {
      "models": {
        "gpt-5.4": { "disabled": true },
        "gpt-5.3-codex": { "disabled": true }
      }
    }
  }
}
```

Fixes anomalyco#21035
@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Apr 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found one potentially related PR:

PR #10116: feat(opencode): add config options to enable or disable models per provider
#10116

This PR appears to address a similar feature - allowing users to enable/disable models at the provider level. It may be worth reviewing to understand how it differs from the current PR #21038, which specifically targets disabling individual models within a provider rather than at the provider level.

However, since PR #21038 is specifically about per-model disabling (more granular) versus provider-level control, they may be complementary rather than duplicative.

@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Apr 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@Ithril-Laydec
Copy link
Copy Markdown

This is a must-have when working with multiple providers. Hope they merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: support disabling individual models within a provider

2 participants