The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
docs: document hermes auth add openai-codex --browser and auth.codex_login_flow
teknium147ab9adc56b0
diff --git a/website/docs/guides/oauth-over-ssh.md b/website/docs/guides/oauth-over-ssh.mdindex 83ce2048eea..1e32549b94f 100644--- a/website/docs/guides/oauth-over-ssh.md+++ b/website/docs/guides/oauth-over-ssh.md@@ -37,7 +37,7 @@ Hermes prints the exact port it bound to on the `Waiting for callback on ...` li| MCP servers (`auth: oauth`) | auto-picked per server | Yes, when Hermes is remote (or paste redirect URL) || `xai-oauth` (Grok SuperGrok) | n/a | No — device code flow || `anthropic` (Claude Pro/Max) | n/a | No — paste-the-code flow |-| `openai-codex` (ChatGPT Plus/Pro) | n/a | No — device code flow |+| `openai-codex` (ChatGPT Plus/Pro) | n/a (default device code); `1455` with `--browser` / `auth.codex_login_flow: browser` | Only for the opt-in browser PKCE flow, when Hermes is remote || `minimax`, `nous-portal` | n/a | No — device code flow || `openrouter` (`hermes auth add openrouter --type oauth`) | OS-assigned, local only | No — over SSH Hermes switches to OpenRouter's headless flow and asks you to paste the code shown in the browser |diff --git a/website/docs/integrations/providers.md b/website/docs/integrations/providers.mdindex f872d61b62e..275a2d7c1d4 100644--- a/website/docs/integrations/providers.md+++ b/website/docs/integrations/providers.md@@ -91,9 +91,9 @@ Don't have a subscription yet? Get one at [portal.nousresearch.com/manage-subscr:::info Codex Note-The OpenAI Codex provider authenticates via device code (open a URL, enter a code). Hermes stores the resulting credentials in its own auth store under `~/.hermes/auth.json` and can import existing Codex CLI credentials from `~/.codex/auth.json` when present. No Codex CLI installation is required. Automatic adoption of the Codex CLI login (when Hermes' own refresh fails) is controlled by `auth.adopt_external_logins` — see [Borrowed CLI logins](../user-guide/security.md#borrowed-cli-logins).+The OpenAI Codex provider authenticates via device code by default (open a URL, enter a code). Organizations that disable the device-code grant can opt in to the browser authorization-code + PKCE flow instead: `hermes auth add openai-codex --browser` (one login) or `auth.codex_login_flow: browser` in `config.yaml` (every Codex login, including `hermes model`). That flow listens on `http://localhost:1455/auth/callback` — the redirect URI registered for the Codex client, so the port is fixed; if it is already taken (a Codex CLI sign-in in progress) Hermes says so and falls back to device code. Over SSH the listener needs a tunnel (`ssh -N -L 1455:127.0.0.1:1455 user@host`, see [OAuth over SSH](../guides/oauth-over-ssh.md)). Hermes stores the resulting credentials in its own auth store under `~/.hermes/auth.json` and can import existing Codex CLI credentials from `~/.codex/auth.json` when present. No Codex CLI installation is required. Automatic adoption of the Codex CLI login (when Hermes' own refresh fails) is controlled by `auth.adopt_external_logins` — see [Borrowed CLI logins](../user-guide/security.md#borrowed-cli-logins).-If a token refresh fails with a terminal error (HTTP 4xx, `invalid_grant`, revoked grant, etc.), Hermes marks the refresh token as dead and stops replaying it so you don't see a flood of identical auth failures. The next request surfaces a typed re-auth message instead. Run `hermes auth add openai-codex` (or `hermes model` → **ChatGPT or Codex Subscription**) to start a fresh device-code login; the quarantine clears on the next successful exchange.+If a token refresh fails with a terminal error (HTTP 4xx, `invalid_grant`, revoked grant, etc.), Hermes marks the refresh token as dead and stops replaying it so you don't see a flood of identical auth failures. The next request surfaces a typed re-auth message instead. Run `hermes auth add openai-codex` (or `hermes model` → **ChatGPT or Codex Subscription**) to start a fresh login (device code, or `--browser` for the loopback PKCE flow); the quarantine clears on the next successful exchange.Device login can fail with `[SSL: UNEXPECTED_EOF_WHILE_READING]` or a TLS handshake timeout on Python/OpenSSL 3.5+ when a middlebox rejects post-quantum groups such as X25519MLKEM768 (curl may still work). A one-off dropped connection is not fatal: while waiting for your browser approval Hermes keeps polling through up to six consecutive transport errors (and retries the device-code request and token exchange twice) before giving up, so only a persistently broken network surfaces this error. Hermes does not change default TLS policy. Point `OPENSSL_CONF` at a config that restricts `Groups` to classic curves before running `hermes model`, or diagnose with TLS 1.2:diff --git a/website/docs/reference/cli-commands.md b/website/docs/reference/cli-commands.mdindex 42dc34484c7..869c3cde6cb 100644--- a/website/docs/reference/cli-commands.md+++ b/website/docs/reference/cli-commands.md@@ -675,6 +675,7 @@ hermes auth add openrouter --api-key sk-or-v1-xxx # Add API keyhermes auth add openrouter --type oauth # Browser login (OpenRouter PKCE) mints a key for youhermes auth add anthropic --type oauth # Add OAuth credentialhermes auth add openai-codex --type oauth --priority 0 # Add an account and try it first+hermes auth add openai-codex --browser # Codex: browser auth-code + PKCE on localhost:1455 instead of device codehermes auth remove openrouter 2 # Remove by indexhermes auth priority openrouter backup-key 0 # Move a credential to the front of fill_first orderhermes auth reset openrouter # Clear cooldownsdiff --git a/website/docs/user-guide/features/credential-pools.md b/website/docs/user-guide/features/credential-pools.mdindex 4ffa5e33a4f..7eae3eab0a1 100644--- a/website/docs/user-guide/features/credential-pools.md+++ b/website/docs/user-guide/features/credential-pools.md@@ -128,6 +128,7 @@ Each `hermes auth add openai-codex` login becomes its own pool entry, but only *| `hermes auth add <provider>` | Add a credential (prompts for type and key) || `hermes auth add <provider> --type api-key --api-key <key>` | Add an API key non-interactively || `hermes auth add <provider> --type oauth` | Add an OAuth credential via browser login |+| `hermes auth add openai-codex --browser` | Codex only: sign in with the browser authorization-code + PKCE flow on `localhost:1455` instead of the default device code (for orgs that disable device-code grants); falls back to device code when the port is busy. Default for every Codex login via `auth.codex_login_flow: browser` || `hermes auth add <provider> --priority 0` | Add a credential and place it first in the `fill_first` order || `hermes auth priority <provider> <target> <n>` | Move a credential to priority `n` (0 = tried first); the rest are renumbered || `hermes auth remove <provider> <index>` | Remove credential by 1-based index |