Skip to content

hermes debug: credential check should include credential_pool OAuth tokens, not just env vars #20675

Description

@teknium1

Summary

hermes debug currently reports API-key status by checking env vars and ~/.hermes/.env entries only. For providers that authenticate via OAuth and store their tokens in auth.json under credential_pool.<provider>[*].access_token — notably Nous Portal, OpenAI Codex, Copilot — the report lists those providers as "not set" even when the user is actively logged in and the CLI is working fine.

This produces misleading debug output:

API Keys Status
  Set: gemini, elevenlabs
  Not set: openrouter, openai, anthropic, anthropic_token, nous, ...

…even when hermes model shows a healthy Nous Portal login and every inference call is succeeding. A reader of the debug report then wastes time chasing an "auth problem" that isn't real.

Reproduction

  1. Fresh machine, no NOUS_API_KEY in env or ~/.hermes/.env.
  2. hermes model → log in to Nous Portal via the OAuth flow. Token lands in auth.json under credential_pool.nous[0].access_token.
  3. Run a few normal CLI turns — they work.
  4. hermes debug (or /debug from inside the CLI).
  5. Report lists nous in the "not set" API keys.

Why this matters

The debug report is the canonical artifact users share when something is broken. Right now it points "auth misconfigured" fingers at whichever provider is being used via OAuth — the exact providers we most want to expose smoothly (Nous Portal is our own). This has already caused at least one instance of the triage workflow spending cycles on "why isn't NOUS_API_KEY set?" before realizing it doesn't need to be.

Proposed fix

In the debug-dump API-keys-status section, before marking a provider as "not set," also check:

  1. credential_pool.<provider>[*].access_token in auth.json (live OAuth tokens)
  2. Any provider-specific non-env credential paths (Codex uses ~/.hermes/credentials/openai-codex.json or similar; Copilot has its own)

Then emit one of three states per provider:

  • Set (env) — found in env var / .env
  • Set (oauth) — found in credential_pool
  • Not set — no credential anywhere

This matches the agent's actual runtime behavior (the provider resolver already checks credential_pool first for these providers) and makes the debug report match reality.

Bonus: surface the provider's credential-resolution status from hermes_cli/providers.py / hermes_cli/auth.py rather than re-walking the filesystem — those modules already know which providers are OAuth-backed and which are key-backed, so the debug dumper shouldn't have to re-implement that logic.

Files likely involved

  • hermes_cli/debug.py (or wherever the debug dump API-keys section is assembled — owner can confirm)
  • Cross-reference: hermes_cli/auth.py, hermes_cli/providers.py, agent/credential_pool.py

Labels

Suggest: enhancement, debug-tooling, user-experience


Filed off the back of a real debug-report diagnosis where provider=nous + model=deepseek-v4-pro showed both keys as "not set" in the report, even though Nous Portal was authenticated and Portal was routing DeepSeek requests normally.

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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions