You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hermes auth add openai-codex must preserve independently added Codex OAuth accounts. The bug this guards against is a second login collapsing earlier pool entries into the latest account, so credential rotation appears configured but repeatedly uses the same account.
Summary
Adds a shared SOURCE_MANUAL_DEVICE_CODE constant for manually added device-code credentials.
Uses that constant when adding Codex OAuth credentials so the add path remains explicit and does not drift back to the singleton device_code source.
Adds regression coverage for adding two distinct Codex OAuth accounts and reloading the pool without collapsing them.
Merged via #42316. Your SOURCE_MANUAL_DEVICE_CODE constant and the direction of this PR — making hermes auth add openai-codex keep accounts distinct rather than collapsing them into the singleton — are exactly what we shipped, with you credited as co-author on the add-path commit (c78b3e1 on main, Co-authored-by: glesperance).
The literal diff here couldn't be cherry-picked cleanly because the Codex add block in auth_commands.py was rewritten on main since this branched (it now routes through _save_codex_tokens). So we reimplemented your intent against current code: a distinct PooledCredential per account via pool.add_entry(), matching the xai/gemini/qwen patterns, plus mark_provider_active_if_unset() so the first add still sets the active provider. Your regression test (two distinct accounts stay distinct) is in the merged suite. Thanks!
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
area/authAuthentication, OAuth, credential poolscomp/cliCLI entry point, hermes_cli/, setup wizardP3Low — cosmetic, nice to havetype/testTest coverage or test infrastructure
3 participants
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.
Rationale
hermes auth add openai-codexmust preserve independently added Codex OAuth accounts. The bug this guards against is a second login collapsing earlier pool entries into the latest account, so credential rotation appears configured but repeatedly uses the same account.Summary
SOURCE_MANUAL_DEVICE_CODEconstant for manually added device-code credentials.device_codesource.Test Plan
python -m pytest tests/hermes_cli/test_auth_commands.py::test_auth_add_codex_oauth_persists_pool_entry tests/hermes_cli/test_auth_commands.py::test_auth_add_codex_oauth_keeps_distinct_pool_accounts -qpython -m pytest tests/hermes_cli/test_auth_commands.py -qpython -m ruff check agent/credential_pool.py hermes_cli/auth_commands.py tests/hermes_cli/test_auth_commands.pygit diff --check