Bug
OAuth-authenticated providers (Nous Portal, OpenAI Codex, Copilot) never appear in the /model gateway picker or list_authenticated_providers() output, even when credentials are properly stored in auth.json.
Root cause
Two issues in model_switch.py, section 2 ("Hermes-only providers") of list_authenticated_providers():
1. Wrong function name (line 794)
from hermes_cli.auth import _read_auth_store # does not exist
store = _read_auth_store()
Should be _load_auth_store. The ImportError is caught by except Exception: pass at line 799, so the entire OAuth credential check is silently skipped.
2. Wrong key lookup (line 796)
if store and pid in store:
_load_auth_store() returns the full auth dict with keys ['version', 'providers', 'active_provider', 'updated_at', 'credential_pool']. Provider entries are under store["providers"] and store["credential_pool"], not at the top level. So pid in store is always False even after fixing the import.
Should be:
if store and (pid in store.get("providers", {}) or pid in store.get("credential_pool", {})):
Impact
/model in gateway only shows env-var-based providers (Kimi, OpenRouter, etc.)
- Nous Portal, OpenAI Codex, and Copilot are invisible in the model picker despite valid OAuth credentials
- Users who authenticated via
hermes auth add nous can't switch to Nous models via /model
- The
except Exception: pass makes this completely silent — no error in logs
Fix
Two-line change in hermes_cli/model_switch.py:
- from hermes_cli.auth import _read_auth_store
- store = _read_auth_store()
- if store and pid in store:
+ from hermes_cli.auth import _load_auth_store
+ store = _load_auth_store()
+ if store and (pid in store.get("providers", {}) or pid in store.get("credential_pool", {})):
Environment
- Hermes Agent v0.7.0 (commit
69c753c1)
- Raspberry Pi 4B, gateway mode (Telegram + Discord)
- Nous Portal OAuth credentials configured via
hermes auth add nous
Bug
OAuth-authenticated providers (Nous Portal, OpenAI Codex, Copilot) never appear in the
/modelgateway picker orlist_authenticated_providers()output, even when credentials are properly stored inauth.json.Root cause
Two issues in
model_switch.py, section 2 ("Hermes-only providers") oflist_authenticated_providers():1. Wrong function name (line 794)
Should be
_load_auth_store. TheImportErroris caught byexcept Exception: passat line 799, so the entire OAuth credential check is silently skipped.2. Wrong key lookup (line 796)
_load_auth_store()returns the full auth dict with keys['version', 'providers', 'active_provider', 'updated_at', 'credential_pool']. Provider entries are understore["providers"]andstore["credential_pool"], not at the top level. Sopid in storeis alwaysFalseeven after fixing the import.Should be:
Impact
/modelin gateway only shows env-var-based providers (Kimi, OpenRouter, etc.)hermes auth add nouscan't switch to Nous models via/modelexcept Exception: passmakes this completely silent — no error in logsFix
Two-line change in
hermes_cli/model_switch.py:Environment
69c753c1)hermes auth add nous