Repository navigation
docs(codex): add Hermes-aware recovery branch for refresh_token_reused (#1542) - #1595
0xDevNinja wants to merge 2 commits into
Conversation
- Codex `refresh_token_reused` is split-brain by default: Hermes `openai-codex` can still serve valid tokens while `~/.codex/auth.json` goes stale, so running `codex login` first wipes a working session - Add a sub-bullet under Error Handling > Auth that branches on a Hermes smoke test, repairs `~/.codex/auth.json` from Hermes tokens when the provider still works, falls back to `codex login` only when both routes are dead - Doc-only; no Codex or Hermes auth behavior changes Fixes garrytan#1542.
|
@0xDevNinja Please rewrite the recovery guidance to use documented commands and exact supported helper syntax. The current text names undocumented hermes ask and unclear codex-auth-sync/hermes-export forms. |
The recovery text named speculative command forms — `hermes ask --provider openai-codex` and `codex-auth-sync` / `hermes export codex-auth` helper scripts — none of which exist in any documented Hermes install. An agent following the skill verbatim would run nonexistent commands. Rewrite both steps capability-level: smoke-test via whatever invocation the local Hermes install documents (`hermes --help`), and repair `~/.codex/auth.json` by locating the openai-codex provider's token store in Hermes' own state directory, explicitly noting there is no standard gstack helper. The diagnostic order and the split-brain explanation are unchanged. Refs garrytan#1542.
|
fair point on the command forms. |
|
Thanks for writing this up, @0xDevNinja, and for revising it after review. We'd rather not have /codex walk an agent through copying OAuth tokens between credential stores, especially out of another tool's undocumented state directory. /codex only tells the user to run |
Summary
/codexError Handling currently funnels every auth error tocodex login.refresh_token_reusedis the one case where that's actively destructive: Hermes'openai-codexprovider can still be serving valid tokens while~/.codex/auth.jsonhas gone stale (split-brain auth), andcodex loginwipes the working Hermes session.Fixes #1542.
Behavior
The new bullet adds three steps in order:
openai-codexprovider (if Hermes is installed) before doing anything else.~/.codex/auth.jsonfrom the Hermes-side tokens, chmod 600, retestcodex exec— nocodex loginneeded.codex loginis the right next step.The skill is also told to tell the user which branch it took before acting, so the user knows whether they're about to nuke a working Hermes session.
Scope
Doc-only: edit to
codex/SKILL.md.tmplError Handling section, plus the regeneratedcodex/SKILL.md(viabun run gen:skill-docs). No code, no auth surface, no tests added — same shape asbun run gen:skill-docstemplate-only doc PRs that have shipped before. The reporter's notes call this out explicitly: "This is documentation/runbook guidance only; it does not change Codex or Hermes auth behavior."The 7 failures are the pre-existing
--dry-run freshness checkcases on non-Claude hosts (Kiro/OpenCode/Slate/Cursor/OpenClaw/Hermes/GBrain) that reproduce onupstream/mainwith this branch's changes stashed — unrelated to this patch.Out of scope
codex-auth-synchelper into gstack. The reporter notes the exact helper script varies by Hermes version; bundling one here would lock us to a specific Hermes layout. Pointing at the helper in prose keeps both sides flexible.command -v hermescheck could move into Step 0 in a follow-up if maintainers prefer.