fix(model): dedupe provider picker entries from config#10327
fix(model): dedupe provider picker entries from config#10327BlackishGreen33 wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
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_slugsdedupe logic to skipproviders:entries whose normalized provider key is already present. - Reserve the corresponding compatibility
custom:<name>slug to prevent the sameproviders:entry from reappearing via thecustom_providerscompatibility 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.
There was a problem hiding this comment.
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.
…ider-picker # Conflicts: # hermes_cli/model_switch.py
|
Thanks for the contribution @BlackishGreen33! After an automated hermes-sweeper review, the dedupe behavior this PR adds is already present on Evidence:
Current This review was performed automatically by hermes-sweeper. |
Summary
The
/modelprovider picker could show the same provider more than once when a provider fromconfig.yamloverlapped with an existing picker entry.Cause
User-defined
providers:entries were added without checking theseen_slugsset that earlier picker sections already used for dedupe.Fix
providers:rows when their normalized provider key is already presentTests
source venv/bin/activate && python -m pytest tests/hermes_cli/test_user_providers_model_switch.py -qsource venv/bin/activate && python -m pytest tests/hermes_cli/test_model_switch_custom_providers.py -qsource venv/bin/activate && python -m pytest tests/hermes_cli/test_overlay_slug_resolution.py -qIssue
Fixes #7524