fix: openai-codex credential rotation — sync guard + 429 token refresh#11727
fix: openai-codex credential rotation — sync guard + 429 token refresh#11727Nicolas-Formenton wants to merge 1 commit into
Conversation
Two fixes for openai-codex multi-account credential rotation: 1. credential_pool.py: _sync_codex_entry_from_cli now only syncs the singleton entry (source='device_code'). Previously it synced ALL exhausted entries, overwriting manual entries' unique tokens with the singleton token from ~/.codex/auth.json. This caused the pool to become N copies of the same account, defeating rotation. 2. run_agent.py: On HTTP 429 for openai-codex, attempt _try_refresh_codex_client_credentials before aborting. This detects token changes made externally (e.g. via hermes-switch) and rebuilds the OpenAI client mid-session, enabling manual credential rotation without restarting the agent. Fixes NousResearch#11364
90a7a4a to
3aecdcf
Compare
|
Thanks for the detailed report and fix, @Nicolas-Formenton! This automated hermes-sweeper review found that both changes in this PR are superseded by work already merged to Fix 1 ( Fix 2 ( Evidence:
This is an automated hermes-sweeper review. |
Two fixes for openai-codex multi-account credential rotation:
1. credential_pool.py:
_sync_codex_entry_from_clinow only syncs the singleton entry (source="device_code"). Previously it synced ALL exhausted entries, overwriting manual entries' unique tokens with the singleton token from~/.codex/auth.json. This caused the pool to become N copies of the same account, defeating rotation.2. run_agent.py: On HTTP 429 for openai-codex, attempt
_try_refresh_codex_client_credentialsbefore aborting. This detects token changes made externally (e.g. via hermes-switch) and rebuilds the OpenAI client mid-session, enabling manual credential rotation without restarting the agent.Fixes #11364