refactor: route list and status through command module#155
refactor: route list and status through command module#155ndycode wants to merge 1 commit intorefactor/pr1-list-status-cli-testsfrom
Conversation
|
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 |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Summary
showAccountStatus()wrapper fromlib/codex-manager.tscodex auth listandcodex auth statusdirectly through the extracted status command moduleWhat Changed
showAccountStatus()helperlist/statusdispatch path to returnrunStatusCommand(...)directly#154exercising both passive commands through the extracted moduleValidation
npm run test -- test/codex-manager-status-command.test.ts test/codex-manager-cli.test.tsnpm run lintnpm run typechecknpm run buildRisk and Rollback
54a5068to restore the inline wrapperAdditional Notes
note: 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 is a clean, low-risk cleanup that eliminates the one-liner
showAccountStatus()wrapper fromlib/codex-manager.tsand routescodex auth list/codex auth statusdirectly throughrunStatusCommand(...).async function showAccountStatus()wrapper (9 lines) that served no purpose beyond indirectionrunStatusCommand({...})directly, which is strictly better than the oldawait + return 0because it propagates any future non-zero exit codes from the modulesetStoragePath,loadAccounts,resolveActiveIndex,formatRateLimitEntry) are identical to what the wrapper was passing — no behavioral changegetNowandlogInfodeps still default toDate.now()/console.log, same as beforecodex-manager-cli.test.ts(lines 601, 616) exercises bothlistandstatusthrough the new path;codex-manager-status-command.test.tscovers the module in isolationConfidence Score: 5/5
runStatusCommandalways returns 0 today so the oldawait + return 0and the newreturn runStatusCommand(...)are equivalent. no filesystem writes, no token handling, no concurrency surface introduced. both cli integration tests pass through the new dispatch path.Important Files Changed
showAccountStatus()inline wrapper and inlines therunStatusCommandcall directly into the dispatch block — functionally equivalent, no behavioral regression, propagation of future non-zero exit codes is now correctSequence Diagram
sequenceDiagram participant CLI as runCodexMultiAuthCli participant OLD as showAccountStatus() (deleted) participant CMD as runStatusCommand (commands/status.ts) participant STORE as loadAccounts / storage Note over CLI,OLD: before this PR CLI->>OLD: await showAccountStatus() OLD->>CMD: runStatusCommand({deps}) CMD->>STORE: setStoragePath(null) + loadAccounts() STORE-->>CMD: AccountStorageV3 | null CMD-->>OLD: return 0 OLD-->>CLI: void CLI-->>CLI: return 0 (hardcoded) Note over CLI,CMD: after this PR CLI->>CMD: return runStatusCommand({deps}) CMD->>STORE: setStoragePath(null) + loadAccounts() STORE-->>CMD: AccountStorageV3 | null CMD-->>CLI: return 0 (propagated)Prompt To Fix All With AI
Last reviewed commit: "refactor: route list..."