fix: prevent duplicate provider entries in /model picker (Section 3 dedup) - #7526
Closed
ShuaiHui wants to merge 1 commit into
Closed
fix: prevent duplicate provider entries in /model picker (Section 3 dedup)#7526ShuaiHui wants to merge 1 commit into
ShuaiHui wants to merge 1 commit into
Conversation
…edup) Section 3 of list_authenticated_providers() iterates over the user's config.yaml `providers:` dict and adds each entry without checking seen_slugs. This causes duplicate entries in the /model picker when a provider exists in both the built-in catalog and the user config. For example, with `nous` in providers: the picker shows both: - "Nous Portal (27)" — from Section 2 (HERMES_OVERLAYS) - "nous (0)" — from Section 3 (user_providers, duplicate) Affected providers: nous, copilot, deepseek, minimax, minimax-cn, etc. Fix: add seen_slugs check at the start of the Section 3 loop and seen_slugs.add() after appending results, consistent with Sections 1/2/4. Fixes #7524 Related: #5223, #7373, #7054
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes duplicate provider entries in the
/modelpicker when a provider exists in both the built-in catalog and the user'sconfig.yamlproviders:section.Problem
list_authenticated_providers()builds the provider list in 4 sections. Section 3 (user-defined providers fromconfig.yamlproviders:) is the only section that doesn't checkseen_slugsbefore adding entries. This causes every provider defined in both the built-in catalog and user config to appear twice:The Section 3 entries always show 0 models because they use
default_model(which is typically empty for built-in provider overrides) instead of the curated model list.Root Cause
In
hermes_cli/model_switch.py,list_authenticated_providers():seen_slugs, adds toseen_slugsseen_slugs, adds toseen_slugsseen_slugs, adds toseen_slugsFix
Add
seen_slugscheck and tracking in Section 3, matching the pattern used by all other sections:Verification
Related