refactor(oauth): move the pool rotation kernel out of the Codex namespace - #4279
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
✅ Deterministic PR hygiene checks passed. |
리뷰 · 우선순위 68 / 80이 PR은 계정 풀 통합 유닛의 2단계 중 커널 추출만 먼저 떼어 온 작업이다. 지금 이 변경은 그 공용 코드를 왜 지금 다만 이 PR만으로는 라인 12 - 메인테이너의 판단이 필요한 지점
너의 추천 이 댓글은 grok-bot이 작성했습니다 |
46df5f9 to
e1e8b25
Compare
Summary
Moves the account-pool rotation primitives out of the Codex namespace so every credential kind can share them, and closes a sweep hole the move exposed.
`src/codex/pool-rotation.ts` never contained anything Codex-specific: it imports two types and nothing else. But living under `src/codex/` made it look like Codex property, which is part of why the generic OAuth kind grew a parallel implementation instead of calling it. This PR moves the whole module, state map included, to `src/oauth/pool-kernel.ts`.
`src/codex/pool-rotation.ts` stays as a re-export shim. That is deliberate: the move is behaviour-preserving, and the shim means `routing.ts`, `auth-api.ts`, `account-priority.ts` and `state-store-registrations.ts` keep their existing import path and are not touched at all.
The move surfaced a real defect. `reconcilePoolRotationState` recognised only `codex`, `codex:` and `anthropic` pool keys and skipped everything else as unknown, so any other pool key would keep its rotation cursor forever after the account behind it was removed. This PR adds `genericPoolKey(provider)` and teaches the sweep to resolve `generic:` from the `provider\0id` roster the Anthropic pass already walks, so no new context field is needed.
No behaviour changes for Codex or Anthropic. This is the extraction step; the generic kind starts consuming its persisted `strategy` in the layer above, behind the `pool.kernel` flag.
Design and audit record: `devlog/_plan/260911_account_pool_unification/020_phase2_shared_kernel.md` (PR #4275). Two audit rounds before any code: the first rejected lifting the Codex fill-first copy, because that would have edited a file another work stream owns, and rejected dropping the generic `inert` flag without a kill switch. Both are folded into the design this PR implements the first half of.
Verification
Checklist