fix(codex): recover hermes auth from cli tokens - #10744
Closed
submit77 wants to merge 1 commit into
Closed
Conversation
Contributor
Author
|
Closing this proactively to avoid duplicate/competing auth-side work. This overlaps too heavily with the already-open Codex auth recovery PR #3279, and I had already commented there rather than intending to open a competing PR. Keeping the branch around in case any specific test cases or narrower follow-up pieces are useful later. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title: fix(codex): recover hermes auth from cli tokens
What does this PR do?
Adds a narrow recovery path for OpenAI Codex auth when Hermes' private auth store is missing valid runtime credentials but the local Codex CLI store still has usable tokens.
Specifically, Hermes now attempts recovery from
~/.codex/auth.jsonwhen:codex_auth_missing)invalid_grantinvalid_tokenIf no valid CLI tokens are available, Hermes preserves the original error.
Related Issue
Fixes #
Type of Change
Changes Made
hermes_cli/auth.py_codex_auth_error_allows_external_recovery()_recover_codex_auth_from_cli()codex_auth_missinginvalid_grant/invalid_tokentests/hermes_cli/test_auth_codex_provider.pyinvalid_grantis preserved when recovery source is missingHow to Test
source venv/bin/activatepython -m pytest tests/hermes_cli/test_auth_codex_provider.py -q -o addopts=Checklist
Code
pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
Targeted verification:
python -m pytest tests/hermes_cli/test_auth_codex_provider.py -q -o addopts=Note: the full repository suite currently has unrelated baseline failures in this environment on
origin/main, so targeted verification was used for this scoped bugfix.