fix(credential-pool): isolate manual Codex accounts - #92198
fix(credential-pool): isolate manual Codex accounts#92198yuzilongleif-collab wants to merge 2 commits into
Conversation
Correctly scoped revert of an over-broad widening: One verification worth stating in the description:
|
Cover the refresh-token-only singleton recovery preserved by NousResearch#92198 alongside the manual-account isolation regression. This characterization is green on both the PR base and head and prevents a future fix from narrowing away the seeded device_code recovery path.
|
Thanks — added the symmetric pin in The new test covers the original #70097 shape directly: the seeded This is intentionally a characterization test: it is green on both PR base A separate gap remains for cross-process resync of independent |
Summary
Restrict runtime Codex auth-store resync to the singleton-seeded
device_codeentry. Independentmanual:device_codepool credentials no longer adopt the active singleton's token pair.Root cause
Commit
7380b48589widened_sync_codex_entry_from_auth_store()to everymanual:device_codeentry so a refresh-token-only singleton recovery could reach manually added credentials. That source string also identifies independent accounts created byhermes auth add openai-codex.During a manual account's refresh path,
_refresh_entry()calls_sync_codex_entry_from_auth_store()first. The broadened guard therefore copiesproviders.openai-codex.tokensinto the independent entry and persists it before refresh. Repeating this across the pool collapses distinct labels onto the currently active account.This regresses the independent-account invariant fixed by #39236 / #42316. The maintainer review on #41704 also states that singleton auth-store sync must remain restricted to
device_code; manual-account healing needs an identity-matched path instead of source-only singleton adoption.Change
agent/credential_pool.py: accept onlyentry.source == "device_code"in_sync_codex_entry_from_auth_store().tests/agent/test_credential_pool.py: add paired coverage proving an independentmanual:device_codeentry is not overwritten, while the seededdevice_codeentry still adopts a rotated refresh token when the singleton has no access token.The refresh-token-only adoption added for #70097 remains unchanged for the singleton-seeded
device_codeentry.Proof of detection
The manual-account isolation test is RED on the base and GREEN here. The seeded refresh-token-only recovery test is intentionally GREEN on both base and head: it is characterization coverage that prevents the fix from swinging too far and deleting the original #70097 recovery.
After the added symmetric coverage:
Command:
git diff --checkalso passes.