Skip to content

fix(model): dedupe provider picker entries from config#10327

Closed
BlackishGreen33 wants to merge 4 commits into
NousResearch:mainfrom
BlackishGreen33:fix/model/dedupe-provider-picker
Closed

fix(model): dedupe provider picker entries from config#10327
BlackishGreen33 wants to merge 4 commits into
NousResearch:mainfrom
BlackishGreen33:fix/model/dedupe-provider-picker

Conversation

@BlackishGreen33

Copy link
Copy Markdown
Contributor

Summary

The /model provider picker could show the same provider more than once when a provider from config.yaml overlapped with an existing picker entry.

Cause

User-defined providers: entries were added without checking the seen_slugs set that earlier picker sections already used for dedupe.

Fix

  • skip providers: rows when their normalized provider key is already present
  • reserve the compatibility custom-provider slug derived from the same display name so the same config entry does not reappear through the compatibility view
  • keep the existing picker slug unchanged so runtime provider resolution behavior does not change

Tests

  • source venv/bin/activate && python -m pytest tests/hermes_cli/test_user_providers_model_switch.py -q
  • source venv/bin/activate && python -m pytest tests/hermes_cli/test_model_switch_custom_providers.py -q
  • source venv/bin/activate && python -m pytest tests/hermes_cli/test_overlay_slug_resolution.py -q

Issue

Fixes #7524

Copilot AI review requested due to automatic review settings April 15, 2026 13:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes duplicate provider entries in the /model provider picker when a provider defined under config.yaml:providers: overlaps with an existing built-in/overlay provider entry.

Changes:

  • Add seen_slugs dedupe logic to skip providers: entries whose normalized provider key is already present.
  • Reserve the corresponding compatibility custom:<name> slug to prevent the same providers: entry from reappearing via the custom_providers compatibility view.
  • Add regression tests covering both dedupe and compatibility-slug reservation behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
hermes_cli/model_switch.py Adds dedupe + compatibility slug reservation in list_authenticated_providers() for providers: config entries.
tests/hermes_cli/test_user_providers_model_switch.py Adds tests ensuring providers: entries don’t duplicate built-in/overlay entries and don’t reappear via custom_providers compatibility slugs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread hermes_cli/model_switch.py Outdated
Comment thread hermes_cli/model_switch.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/hermes_cli/test_user_providers_model_switch.py
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard labels Apr 26, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the contribution @BlackishGreen33! After an automated hermes-sweeper review, the dedupe behavior this PR adds is already present on main.

Evidence:

  • ca3a0bbc5 (Apr 19 2026)fix(model-picker): dedup overlapping providers: dict and custom_providers: list entries — introduced _section3_emitted_pairs, which records (display_name, base_url) for every section-3 row; section 4 skips any group whose pair matches. This is a superset of this PR's reserved_compatibility_entries mechanism.
  • c1977146c (Apr 20 2026)fix(model_switch): register custom: slug in seen_slugs for Section 3 providers — added seen_slugs.add(custom_provider_slug(display_name).lower()) after section-3 emits, which is the specific missing registration this PR's first commit addresses.
  • 5a23f3291fix(model_switch): section 3 base_url/model/dedup follow-up — follow-on cleanup to the same area.

Current main at hermes_cli/model_switch.py lines 1265–1334 already implements both the slug-level and endpoint-level dedup that close issue #7524. The PR's diff also no longer applies cleanly because the surrounding context lines have evolved on main since the PR was authored.

This review was performed automatically by hermes-sweeper.

@teknium1 teknium1 closed this Apr 27, 2026
@BlackishGreen33 BlackishGreen33 deleted the fix/model/dedupe-provider-picker branch April 27, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: /model provider picker shows duplicate entries when provider exists in both built-in catalog and config.yaml

4 participants