Skip to content

Bug: /model picker ignores custom_providers.models and only shows one model #8216

@Brisbanehuang

Description

@Brisbanehuang

Summary

The /model picker in the gateway/Telegram flow only shows a single model for custom_providers entries, even when the provider config contains multiple models under custom_providers[].models.

This appears to happen because the picker/listing path reads only custom_providers[].model and ignores custom_providers[].models.

Sanitized example config

model:
  default: model-a
  provider: custom
  base_url: https://redacted-gateway.example/v1

custom_providers:
  - name: Redacted Gateway
    base_url: https://redacted-gateway.example/v1
    model: model-a
    models:
      model-a: {}
      model-b: {}
      model-c: {}
      model-d: {}

Steps to reproduce

  1. Configure a custom provider only under custom_providers: with one default model in model: / custom_providers[].model and several available models under custom_providers[].models.
  2. Open /model in Telegram or another gateway surface that uses the interactive provider/model picker.
  3. Select the custom provider.

Expected behavior

The provider button should show the total number of configured models from custom_providers[].models, and the next picker step should list those configured models.

Using the sanitized example above, the provider should show (4) and the picker should offer model-a, model-b, model-c, and model-d.

Actual behavior

The provider shows only (1), and after selecting it the picker shows only the single value from custom_providers[].model (for example model-a).

Suspected root cause

hermes_cli/model_switch.py list_authenticated_providers() currently builds the custom-provider model list from entry.get("model") only and does not consume entry.get("models").

That means:

  • models_list contains only one item
  • total_models is reported as 1
  • the Telegram picker downstream receives only that single model

Why this matters

This makes /model appear broken for custom OpenAI-compatible gateways that intentionally expose multiple models through a single endpoint.

It also creates a mismatch with other Hermes paths that already read richer metadata from custom_providers.

Suggested fix

When building picker data for custom_providers, merge in model IDs from custom_providers[].models.

At minimum:

  • if entry["models"] is a dict, use its keys as the available model IDs
  • fall back to entry["model"] only when entry["models"] is absent or empty
  • set total_models from the full model set, not just the default model

Notes

This report uses a redacted provider name and redacted base URL. It does not include any user-private endpoint details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/cliCLI entry point, hermes_cli/, setup wizardcomp/gatewayGateway runner, session dispatch, deliverytype/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