refactor: extract status and features handlers#151
refactor: extract status and features handlers#151ndycode wants to merge 2 commits intorefactor/pr1-manager-command-splitfrom
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Important Review skippedAuto reviews are limited based on label configuration. 🚫 Review skipped — only excluded labels are configured. (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
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 |
Summary
codex auth list/statusandcodex auth featureshandlers into a dedicated command moduleWhat Changed
lib/codex-manager/commands/status.tsfor account status output and implemented-features outputlib/codex-manager.tsso the status and features paths delegate through the new command moduletest/codex-manager-status-command.test.tsfor empty-pool, account-marker, and feature-list coverageValidation
npm run lintnpm run typechecknpm run test -- test/codex-manager-status-command.test.ts test/codex-manager-switch-command.test.ts test/codex-manager-cli.test.tsnpm run buildRisk and Rollback
0abd05ato restore the inline status/features handlersAdditional Notes
#150to keep the manager split reviewable in one-worktree slicesnote: greptile review for oc-chatgpt-multi-auth. cite files like
lib/foo.ts:123. confirm regression tests + windows concurrency/token redaction coverage.Greptile Summary
this PR extracts
codex auth list/statusandcodex auth featuresfrom the monolithiccodex-manager.tsinto a dedicatedlib/codex-manager/commands/status.tscommand module with injected dependencies, continuing the manager command-split refactor from pr #150.the extraction is architecturally sound —
getStoragePath,loadAccounts,resolveActiveIndex, andformatRateLimitEntryare all correctly injected throughStatusCommandDeps, and the delegation callsite incodex-manager.tsis clean. two gaps need attention before this is fully solid:formatCooldownis imported directly rather than injected like the other account-level helpers. the cooldown marker branch inrunStatusCommandis unreachable from unit tests, inconsistent with howformatRateLimitEntryis treated, and has no test coverage.accounts.length === 0branch is untested — the existing empty-pool test only coversloadAccountsreturningnull, leaving the zero-entry array path dark.Confidence Score: 4/5
Important Files Changed
formatCooldownas a direct import — cooldown marker branch is untestable from unit tests and has zero coverageaccounts.length === 0empty-array branch and the cooldown marker branch both lack test casesSequence Diagram
sequenceDiagram participant CLI as codex-manager.ts participant SC as status.ts<br/>runStatusCommand participant ST as storage.ts<br/>loadAccounts / getStoragePath participant AC as accounts.ts<br/>formatRateLimitEntry / formatCooldown CLI->>SC: runStatusCommand({ setStoragePath, getStoragePath, loadAccounts, ... }) SC->>ST: deps.setStoragePath(null) SC->>ST: deps.loadAccounts() ST-->>SC: AccountStorageV3 | null SC->>ST: deps.getStoragePath() ST-->>SC: string | null alt no accounts SC-->>CLI: 0 (prints empty state) else accounts present loop each account SC->>SC: deps.formatRateLimitEntry(account, now, "codex") SC->>AC: formatCooldown(account, now) [hardwired import — not injected] AC-->>SC: string | null end SC-->>CLI: 0 (prints account rows) endPrompt To Fix All With AI
Last reviewed commit: "fix(status): inject ..."