fix(doctor): attach codex CLI hint to OpenAI Codex auth warning for #27975

`hermes doctor` printed 'codex CLI not installed (optional — ...)' as a
generic info line at the bottom of the auth section, several rows below
'OpenAI Codex auth (not logged in)' and after MiniMax/Gemini auth checks.
Users reading sequentially mistook it for MiniMax-related advice.

Move the hint up under the Codex auth warning so it's adjacent to the
row it actually pertains to. Behavior unchanged when the codex CLI is
installed (success path keeps its 'codex CLI ✓' row at the bottom).
Tests cover both placement and suppression cases.

Salvage of @xxxigm's 3-commit stack (#27986).
Closes #27975.
This commit is contained in:
xxxigm 2026-05-19 00:14:33 -07:00 committed by Teknium
parent 4039e2abb5
commit 12c39830f0
2 changed files with 94 additions and 12 deletions

View file

@ -799,6 +799,16 @@ def run_doctor(args):
check_warn("OpenAI Codex auth", "(not logged in)")
if codex_status.get("error"):
check_info(codex_status["error"])
# Native OAuth uses Hermes' own device-code flow — the Codex CLI is
# only needed to import existing tokens from ~/.codex/auth.json.
# Attach the hint to the Codex auth row so it doesn't read as
# remediation for whichever provider happens to print next (#27975).
if not _safe_which("codex"):
check_info(
"codex CLI not installed "
"(optional — only required to import tokens "
"from an existing Codex CLI login)"
)
gemini_status = get_gemini_oauth_auth_status()
if gemini_status.get("logged_in"):
@ -837,18 +847,6 @@ def run_doctor(args):
except Exception:
pass
if _safe_which("codex"):
check_ok("codex CLI")
else:
# Native OAuth uses Hermes' own device-code flow — the Codex CLI is
# only needed if you want to import existing tokens from
# ~/.codex/auth.json. Downgrade to info so users running
# `hermes auth openai-codex` aren't told they're missing something.
check_info(
"codex CLI not installed "
"(optional — only required to import tokens from an existing Codex CLI login)"
)
_section("Directory Structure")
hermes_home = HERMES_HOME
if hermes_home.exists():