Skip to content

Empty credential pool entries cause providers to show as authenticated in /model picker #28140

@dreammu

Description

@dreammu

Description

When a provider is removed from .env (e.g. MINIMAX_CN_API_KEY deleted), but an empty credential pool entry remains in auth.json, the /model picker still shows the provider as available.

Steps to Reproduce

  1. Configure minimax-cn via hermes model or by setting MINIMAX_CN_API_KEY in .env
  2. Remove the env var from .env
  3. Observe that ~/.hermes/auth.json still has "minimax-cn": [] in credential_pool
  4. Run /model in Telegram/Discord — minimax-cn still appears as selectable

Root Cause

In hermes_cli/model_switch.py (line 1234-1236):

if store and hermes_id in store.get("credential_pool", {}):
    has_creds = True

The check only verifies that hermes_id is a key in the credential_pool dict. It does NOT check whether the array is non-empty. So "minimax-cn": [] still evaluates to has_creds = True.

Expected Behavior

An empty credential pool entry should be treated the same as no entry — the provider should not appear in the /model picker unless it has actual credentials.

Suggested Fix

pool_entries = store.get("credential_pool", {}).get(hermes_id, [])
if pool_entries:
    has_creds = True

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existsarea/authAuthentication, OAuth, credential poolscomp/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