fix: align codex auth status with usable credentials#10286
Conversation
bf82d8a to
6c6c35b
Compare
|
Adjacent note: legacy Codex auth-store status checks on current main are still not fully passive. get_codex_auth_status() can still hit the refreshing runtime resolver in the legacy fallback path, which means status checks and resolve_provider("auto") may refresh tokens as a side effect. I verified a narrow local fix that reads persisted auth state directly instead, with focused tests passing locally. I’m not planning a standalone PR unless it would be useful; just flagging it in case it fits here or as a small follow-up. Intended behavior: status checks and provider auto-detect should be passive for legacy Codex auth-store state. |
|
Good catch — I reproduced this on current main and folded the fix into this PR. What changed:
Validation run locally:
Latest commit on the branch: |
|
Thanks for the submission @redf0x1. Closing as superseded — the Hermes's Codex auth design was reworked in #12360 ("Hermes owns its own Codex auth; stop touching The valid adjacent fixes from this batch (error parsing, fallback chain on auth failure, reauth UX) landed together in #15104. |
Problem
PR #10282 fixes immediate credential rotation, but Hermes could still accept unusable Codex auth state before rotation ever had a chance to help. In practice that means malformed / placeholder / stale singleton auth could still poison runtime selection and auxiliary fallback paths.
Root cause
~/.codex/auth.jsonstate, which made the verification surface noisyFix
Runtime changes
hermes_cli/auth.py_codex_access_token_looks_usable()_codex_refresh_token_looks_usable()_codex_token_pair_looks_usable()agent/credential_pool.pyagent/auxiliary_client.pyhermes_cli/model_switch.pyTest hardening
~/.codex/auth.jsonso the suite reflects repository behavior, not machine-local auth residueScope
Included:
Excluded:
Testing
Relationship to PR #10282
They are intentionally split because they solve two different failure layers: