fix(auth): share Codex OAuth across profiles - #28277
Conversation
teknium1
left a comment
There was a problem hiding this comment.
Thanks for chasing this. I can verify the premise still exists on current main, but this PR needs a current-main salvage rather than a direct apply.
Problems
hermes_cli/auth.py:3365andhermes_cli/auth.py:3509on current main still use the active profile auth store for Codex singleton reads/writes, so the profile/root rotation hazard is real.- The PR's
_save_codex_tokensedit is based on an older body. Current main haslabelsupport plus credential-pool synchronization athermes_cli/auth.py:3528; applying this version would drop that newer behavior. - The PR only covers
providers.openai-codex. Current main also has Codex pool fallback athermes_cli/auth.py:3855and pool refresh/sync behavior inagent/credential_pool.py; those sibling paths would still read profile-local pool state. The later related #34121 diff touches those paths, which is a useful signal for the missing scope.
Suggested changes
- Port the shared-root Codex lock/store idea onto current main while preserving
_save_codex_tokens(tokens, last_refresh=None, label=None),_sync_codex_pool_entries, and the independentmanual:device_codesafeguards. - Add regression coverage for both singleton state and
credential_pool.openai-codexin named profiles, including profile-triggered writes back to the shared/root pool.
Automated hermes-sweeper review.
| @@ -3010,17 +3044,17 @@ def _read_codex_tokens(*, _lock: bool = True) -> Dict[str, Any]: | |||
|
|
|||
|
|
|||
There was a problem hiding this comment.
This replacement is based on an older _save_codex_tokens body. Current main also accepts label and syncs provider updates into credential_pool.openai-codex; the shared-root write needs to preserve those newer behaviors or Codex re-auth will regress pool users.
|
Thanks for addressing the cross-profile Codex refresh-token problem. The singleton premise remains valid on current main: Problems
Suggested changes
Automated hermes-sweeper review. |
Summary
Test Plan