Skip to content

Bug: providers: dict models list silently dropped, causes duplicate entry with 0 models in /model picker #11017

@alexcam1901

Description

@alexcam1901

Bug Description

When a provider is defined under the top-level providers: dict in config.yaml with a models: key as a YAML list, the models list is silently dropped during normalization. This causes the provider to appear twice in the /model picker — once correctly (from the raw providers: dict, showing the models) and once with 0 models (from the get_compatible_custom_providers() path, which converts it via _normalize_custom_provider_entry()).

Steps to Reproduce

  1. Add a provider to config.yaml using the providers: dict format with a list under models::
providers:
  apigw2:
    api: https://example.com/api/v1
    api_key: your-key-here
    models:
      - model-a
      - model-b
  1. Open the /model picker.
  2. Observe apigw2 appears twice: once with 2 models, once with 0 models.

Root Cause

In hermes_cli/config.py, _normalize_custom_provider_entry() only copies the models field when it is a dict:

# config.py ~line 1690
models = entry.get("models")
if isinstance(models, dict) and models:
    normalized["models"] = models

But the providers: dict format uses a plain list for models:. So the list is dropped, producing a normalized entry with no models.

get_compatible_custom_providers() calls providers_dict_to_custom_providers() which calls _normalize_custom_provider_entry() on every providers: dict entry, then merges the result with the existing compatible providers list. The resulting entry for apigw2 has no models key, and deduplication fails because the two entries have different shapes, so both survive into the picker.

Expected Behavior

_normalize_custom_provider_entry() should accept models as either a list or a dict. The provider should appear exactly once in the picker, with all configured models selectable.

Suggested Fix

models = entry.get("models")
if isinstance(models, (list, dict)) and models:
    normalized["models"] = models

Environment

  • Hermes Agent: latest main (cloned from NousResearch/hermes-agent)
  • macOS arm64
  • Config format: providers: dict (not legacy custom_providers: list)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existsarea/configConfig system, migrations, profilescomp/cliCLI entry point, hermes_cli/, setup wizardtype/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