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
- Configure minimax-cn via
hermes model or by setting MINIMAX_CN_API_KEY in .env
- Remove the env var from
.env
- Observe that
~/.hermes/auth.json still has "minimax-cn": [] in credential_pool
- 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
Description
When a provider is removed from
.env(e.g.MINIMAX_CN_API_KEYdeleted), but an empty credential pool entry remains inauth.json, the/modelpicker still shows the provider as available.Steps to Reproduce
hermes modelor by settingMINIMAX_CN_API_KEYin.env.env~/.hermes/auth.jsonstill has"minimax-cn": []incredential_pool/modelin Telegram/Discord — minimax-cn still appears as selectableRoot Cause
In
hermes_cli/model_switch.py(line 1234-1236):The check only verifies that
hermes_idis a key in thecredential_pooldict. It does NOT check whether the array is non-empty. So"minimax-cn": []still evaluates tohas_creds = True.Expected Behavior
An empty credential pool entry should be treated the same as no entry — the provider should not appear in the
/modelpicker unless it has actual credentials.Suggested Fix