fix(model): Fix command 'hermes model' to allow reuse, reauthentication, or new auth when for OpenAI Codex Auth to match the Anthropic flow#4522
Closed
MattMaximo wants to merge 1 commit into
Conversation
2 tasks
Contributor
|
This PR's changes are already live on An automated hermes-sweeper review confirmed the following:
Thanks for the contribution, @MattMaximo! |
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.
Summary
hermes modeltreated Anthropic and OpenAI Codex differently once a user was already authenticated. Anthropic asked whether to keep existing credentials or start a new login, but Codex skipped straight to model selection with no way to rotate auth from the same flow.This PR makes the Codex model flow match the Anthropic UX:
Use existing credentials/Reauthenticate (new OAuth login)/Cancelwhen Codex is already logged in~/.codex/auth.jsonpath for first-time or not-yet-logged-in Codex setupWhy
Hermes keeps its own Codex auth state in
~/.hermes/auth.jsonto avoid refresh-token conflicts with Codex CLI / VS Code. That separation is the right default, but it also means users need an explicit way to say "keep this Hermes session" vs "start a new Hermes-owned session" fromhermes model, not only during the first login.Behavior before
hermes model -> Anthropicprompted for existing vs new authhermes model -> OpenAI Codexdid not when already logged inBehavior after
hermes model -> OpenAI Codexnow presents the same keep-or-reauth choiceTests
uv run --with pytest --with pytest-xdist python -m pytest tests/test_codex_models.py tests/test_auth_codex_provider.py -qNotes
uv run --with pytest --with pytest-xdist python -m pytest tests/ -q, but currentorigin/mainis failing broadly across many unrelated tests on this checkout, so I limited validation to the affected Codex/auth surface area.