Skip to content

fix(model_switch): deduplicate custom providers — register prefixed slug in seen_slugs#13154

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-924d4bf9
Apr 20, 2026
Merged

fix(model_switch): deduplicate custom providers — register prefixed slug in seen_slugs#13154
teknium1 merged 1 commit into
mainfrom
hermes/hermes-924d4bf9

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Registers custom_provider_slug(display_name).lower() in seen_slugs after Section 3 emits a user-defined provider, so Section 4's dedup check correctly suppresses the duplicate entry.

Closes #12293. Salvaged from PR #13114 (@bennytimz).

Changes

  • hermes_cli/model_switch.py: +1 line after Section 3's seen_slugs.add(ep_name.lower())

Validation

Before After
Custom provider in both sections Two rows in /model picker One row
Section-4-only provider One row One row (no regression)

63 existing tests pass.

…providers

Section 3 (user-defined endpoints) added the plain ep_name to seen_slugs
but not the custom:-prefixed slug. Section 4 generates custom:<name> via
custom_provider_slug() and checks seen_slugs — since the prefixed slug
was missing, the same provider appeared twice in /model.

Register custom_provider_slug(display_name).lower() in seen_slugs after
Section 3 emits a provider, so Section 4's dedup correctly suppresses
the duplicate.

Closes #12293.
Co-authored-by: bennytimz <bennytimz@users.noreply.github.com>
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.

[Bug]: Duplicate custom providers not filtered — slug mismatch between custom_provider_slug() and seen_slugs

1 participant