fix(auth): canonicalize inherited Codex refresh state - #64572
Conversation
|
Thanks for carrying the canonical-source approach through both Codex singleton and credential-pool paths. Current main still has the reported ownership gap: inherited singleton resolution reads through The PR preserves the accepted root-fallback model while making Codex ownership explicit ( Automated hermes-sweeper review. |
|
Halo validation: PR #64572 is still OPEN and CONFLICTING with main. I attempted the supported GraphQL updatePullRequestBranch(REBASE) mutation, but the authenticated account solovision24 is forbidden from updating Thomisso's cross-repository branch (maintainerCanModify is true, but this token lacks that permission). Please rebase fix/codex-canonical-profile-auth onto current main, then I can rerun the focused auth/pool suites and close out the Kanban task. |
SummaryThirty-seven PRs address or reference this Codex OAuth/auth-store complex. Their diffs span CLI-token isolation and recovery, profile/global pool fallback, rotating-token serialization and root write-through, sibling-profile recovery, usage lookup, diagnostics, and adjacent credential-pool concurrency fixes; the remaining #6653 ownership gap is most comprehensively targeted by #64572. Related pull requests
Duplicates#15173 and #17480 share the /usage/pool fallback path; #28277, #34121, #39352, #43415, #47221, #47233, and #48364 are shared/canonical Codex-store variants; #48416, #49032, #49127, #50632, #51753, and #52760 are the root write-through chain; #39796 and #41705 are sibling-copy recovery variants. #11512 is contained in #15104, #65844 is contained in #70147, and #34820's narrow refresh-lock portion is contained in #56233. Suggested consolidationAuthor action on #64572: rebase onto current main and rerun the focused singleton/profile/pool ownership suites; this follows its recorded #6653 best-fix status and keep_open/high-salvage review without recommending a merge. Keep #34141 open as the focused #34143 salvage and keep #39796 only pending exact-head comparison with rebased #64572; close #28277, #38273, #41704, #41705, and #49170 as superseded by that canonical-source cut if their distinct reviewed concerns are covered, and close #39222 because its contributor review documents the opposite profile-boundary decision. Complex graphflowchart LR
classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
classDef best stroke-width:3px,stroke:#b45309
classDef target stroke-width:3px,stroke:#4338ca
I6653(["issue #6653 (open)"])
I34143(["issue #34143 (open)"])
P64572["PR #64572 (open)"]
P64572 -->|best fix| I6653
P64572 -->|fixes| I34143
class I6653 open
class I34143 open
class P64572 open
class P64572 best
class P64572 target
click I6653 "https://github.com/NousResearch/hermes-agent/issues/6653"
click I34143 "https://github.com/NousResearch/hermes-agent/issues/34143"
click P64572 "https://github.com/NousResearch/hermes-agent/pull/64572"
Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label). Cross-PR triage: Reviewed 37 pull requests and 6 issues in this complex. Each diff was read against this issue; Assessment working set: 749 kB of PR diffs, 106 kB of issue/PR text, 51 kB of discussion (65 comments), 52 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch. |
What does this PR do?
Makes the default/root Hermes auth store the canonical source for inherited
openai-codexOAuth state across named profiles.Codex refresh tokens rotate and are single-use. A named profile could previously read an inherited root grant, refresh it while locking or persisting the active profile store, and leave root or another in-memory pool snapshot holding stale state. That can cause
refresh_token_reused, recreate local profile shadows, or roll a separately refreshed pool row backward.This ports and completes the canonical-root direction proposed in #28277 on current
main, including the credential-pool path requested by its review. It complements #41705 without scanning sibling profile stores, and extends the root write-through landed in #52760 with canonical ownership, locking, and stale-snapshot-safe persistence.Related Issue
Fixes #6653
Related: #28277, #41705, #52760
Type of Change
Changes Made
hermes_cli/auth.pyagent/credential_pool.pyHow to Test
A live Linux/ARM64 multi-profile deployment was also migrated to one root Codex pool. Five independent profile invocations returned successful Codex responses, named-profile stores remained shadow-free after the calls, and all persistent gateways remained healthy.
The full repository suite was attempted on the ARM64 Raspberry Pi host but was stopped at 16% after roughly nine minutes because it was not practical to complete there. CI should provide the complete repository result; the entire affected auth and credential-pool suite passed.
Checklist
Code
pytest tests/ -qsuite locally (affected suite: 449 passed; full suite deferred to CI)Documentation & Housekeeping
cli-config.yaml.example: N/A; no config keys addedCONTRIBUTING.md/AGENTS.md: N/A; no contributor workflow changeDesign lineage
Credit to #28277 for proposing the canonical-root Codex store direction. This PR is a current-main completion of that approach across both singleton and credential-pool paths, incorporating the maintainer review request to retain current pool behavior and avoid sibling-store freshness heuristics.