Skip to content

fix(auth): keep manual Codex pool entries isolated - #11382

Closed
yeyitech wants to merge 1 commit into
NousResearch:mainfrom
yeyitech:fix/issue-11364-codex-pool-sync
Closed

fix(auth): keep manual Codex pool entries isolated#11382
yeyitech wants to merge 1 commit into
NousResearch:mainfrom
yeyitech:fix/issue-11364-codex-pool-sync

Conversation

@yeyitech

Copy link
Copy Markdown
Contributor

Summary

  • restrict _sync_codex_entry_from_cli() so only the singleton device_code entry can sync from ~/.codex/auth.json
  • keep manual manual:device_code pool entries isolated from the shared Codex CLI token store
  • add a regression test proving manual pool entries remain untouched while the singleton entry refreshes

Closes #11364.

Testing

  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m pytest -o addopts= tests/agent/test_credential_pool.py -q

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint area/auth Authentication, OAuth, credential pools provider/copilot GitHub Copilot (ACP + Chat) labels Apr 25, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #11727 and #9173 — all address _sync_codex_entry_from_cli overwriting manual pool entries. Closed #12924 was an earlier attempt at the same fix.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the careful fix and regression test, @yeyitech! This is a well-reasoned narrower guard.

However, this PR can no longer be merged — the function it patches (_sync_codex_entry_from_cli) was removed entirely from agent/credential_pool.py by PR #12360 (merged 2026-04-18, one day after this PR was opened). That PR took Option C from issue #11364: removing the ~/.codex/auth.json runtime sync path entirely, so Hermes now owns its Codex auth state end-to-end and never reads from ~/.codex/auth.json at runtime.

The underlying bug this PR addresses is resolved. Closing as implemented on main.

This is an automated hermes-sweeper review.

@teknium1 teknium1 closed this Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/auth Authentication, OAuth, credential pools comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists provider/copilot GitHub Copilot (ACP + Chat) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

openai-codex credential pool: _sync_codex_entry_from_cli overwrites all entries with the same token

3 participants