Skip to content

OAuth providers (Nous, Codex) missing from /model picker — ImportError silently caught #5910

@linxule

Description

@linxule

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

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