Skip to content

fix(core): respect whitelist when filtering deprecated models#15539

Open
zerone0x wants to merge 1 commit intoanomalyco:devfrom
zerone0x:fix/issue-15430-whitelist-deprecated-models
Open

fix(core): respect whitelist when filtering deprecated models#15539
zerone0x wants to merge 1 commit intoanomalyco:devfrom
zerone0x:fix/issue-15430-whitelist-deprecated-models

Conversation

@zerone0x
Copy link
Contributor

@zerone0x zerone0x commented Mar 1, 2026

Issue for this PR

Closes #15430

Type of change

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

What does this PR do?

Models marked as deprecated were unconditionally deleted from the provider's model list before the whitelist check ran. This meant that even if a user explicitly whitelisted a deprecated model (e.g., kimi-k2.5-free, glm-5-free), it would be removed and never appear in the available models.

The fix adds a whitelist guard to the deprecated-model deletion:

- if (model.status === "deprecated") delete provider.models[modelID]
+ if (model.status === "deprecated" && !configProvider?.whitelist?.includes(modelID)) delete provider.models[modelID]

Now, if a model is both deprecated and explicitly listed in the provider's whitelist, it is preserved. All other deprecated models are still deleted as before. The subsequent whitelist/blacklist filter (lines 1002-1006) continues to handle the general case.

How did you verify your code works?

  • Read the filtering logic and confirmed the ordering issue described in the bug report
  • Verified the fix preserves existing behavior for non-whitelisted deprecated models (the condition falls through to true when there is no whitelist)
  • The optional chaining (configProvider?.whitelist?.includes) safely handles missing config/whitelist

Checklist

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

🤖 Generated with Claude Code

Deprecated models were unconditionally deleted before the whitelist
check, making it impossible to use whitelisted deprecated models like
kimi-k2.5-free or glm-5-free. Now the deprecated filter skips models
that appear in the provider's whitelist.

Fixes anomalyco#15430

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Whitelist doesn't work for deprecated models - models are deleted before whitelist check

1 participant