Skip to content

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

@wl-lgtm

Description

@wl-lgtm

Bug Description

Section 3 (user config providers) and Section 4 (built-in registry) use different slug formats when tracking duplicates.

Steps to Reproduce

  1. Define a custom provider in ~/.hermes/config.yaml with a slug like api.us-west-2.modal.direct
  2. The same provider also exists in the built-in registry cache
  3. Run /model — duplicate appears

Expected Behavior

When a custom provider is defined in ~/.hermes/config.yaml and also exists in the built-in registry cache, the duplicate should be detected and skipped. /model lists each provider once.

Actual Behavior

The same provider appears twice in /model. Section 3 adds the plain slug (api.us-west-2.modal.direct) to seen_slugs. Section 4 generates the custom:-prefixed slug (custom:api.us-west-2.modal.direct), doesn't find it in seen_slugs, and emits a duplicate entry.

Affected Component

Configuration (config.yaml, .env, hermes setup)

Messaging Platform (if gateway-related)

No response

Debug Report

Report       https://paste.rs/xRdjc
  agent.log    https://paste.rs/tph11
  gateway.log  https://paste.rs/JIrdN

Operating System

Mac OS 26.3.1(a)

Python Version

No response

Hermes Version

No response

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

custom_provider_slug() (line ~491 of providers.py) prefixes slugs with custom:, e.g. custom:api.us-west-2.modal.direct. But Section 3 only adds the plain key (api.us-west-2.modal.direct) to seen_slugs. Section 4 then generates the custom:-prefixed version, doesn't find it in seen_slugs, and emits a duplicate.

Proposed Fix (optional)

After adding a custom provider in Section 3, also add the prefixed slug:
seen_slugs.add(custom_provider_slug(display_name))
(line ~1072)

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions