Skip to content

refactor: route features through command module#156

Closed
ndycode wants to merge 1 commit intorefactor/pr1-remove-inline-status-wrapperfrom
refactor/pr1-remove-inline-features-wrapper
Closed

refactor: route features through command module#156
ndycode wants to merge 1 commit intorefactor/pr1-remove-inline-status-wrapperfrom
refactor/pr1-remove-inline-features-wrapper

Conversation

@ndycode
Copy link
Owner

@ndycode ndycode commented Mar 20, 2026

Summary

  • remove the remaining inline features wrapper from lib/codex-manager.ts
  • route the features command directly through the extracted command module

What Changed

  • deleted the now-redundant runFeaturesReport() wrapper
  • updated the features dispatch path to call runFeaturesCommand(...) directly with the existing feature matrix

Validation

  • npm run test -- test/codex-manager-status-command.test.ts test/codex-manager-switch-command.test.ts test/codex-manager-check-command.test.ts test/codex-manager-report-command.test.ts test/codex-manager-cli.test.ts
  • npm run lint
  • npm run typecheck
  • npm run build

Risk and Rollback

  • Risk level: low
  • Rollback plan: revert f29cf31 to restore the inline features wrapper

Additional Notes

  • this keeps reducing the command dispatcher noise without changing command behavior

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 removes the redundant runFeaturesReport() one-liner wrapper in lib/codex-manager.ts and calls runFeaturesCommand({ implementedFeatures: IMPLEMENTED_FEATURES }) directly at the dispatch site. behavior is unchanged — it's a pure noise-reduction refactor that brings the features dispatch in line with how other extracted commands (check, status, report) are already wired.

  • runFeaturesReport() deleted — it was a one-liner with no added value.
  • dispatch site updated to call runFeaturesCommand(...) directly with the existing IMPLEMENTED_FEATURES constant.
  • unit coverage exists in test/codex-manager-status-command.test.ts (runFeaturesCommand isolated with a mock list).
  • integration coverage exists in test/codex-manager-cli.test.ts (full dispatch path, verifies 41-feature count and last feature name).
  • no windows filesystem, token safety, or concurrency concerns — this is a synchronous, read-only console output path with no i/o or shared state.
  • one pre-existing structural note: runFeaturesCommand lives in lib/codex-manager/commands/status.ts alongside runStatusCommand, unlike the pattern where each command gets its own file (check.ts, report.ts, switch.ts). this pr doesn't introduce that gap, but a follow-up features.ts extraction would complete the pattern.

Confidence Score: 5/5

  • safe to merge — trivial one-liner deletion with full unit + integration test coverage and no behavioral change.
  • the diff is 4 lines removed and 1 line changed. the removed wrapper was a zero-logic indirection (return runFeaturesCommand({ implementedFeatures: IMPLEMENTED_FEATURES })). the call site now does the same thing directly. both the extracted function and the full cli dispatch path are covered by existing vitest suites.
  • no files require special attention.

Important Files Changed

Filename Overview
lib/codex-manager.ts removes the one-liner runFeaturesReport() wrapper and calls runFeaturesCommand({ implementedFeatures: IMPLEMENTED_FEATURES }) directly at the dispatch site — behavior is identical, both the unit test in codex-manager-status-command.test.ts and the integration test in codex-manager-cli.test.ts (lines 916–930) cover the path.

Sequence Diagram

sequenceDiagram
    participant CLI as runCodexMultiAuthCli
    participant OLD as runFeaturesReport (deleted)
    participant CMD as runFeaturesCommand

    note over CLI,OLD: before this PR
    CLI->>OLD: command === "features"
    OLD->>CMD: runFeaturesCommand({ implementedFeatures })
    CMD-->>OLD: 0
    OLD-->>CLI: 0

    note over CLI,CMD: after this PR
    CLI->>CMD: command === "features" → runFeaturesCommand({ implementedFeatures })
    CMD-->>CLI: 0
Loading

Last reviewed commit: "refactor: route feat..."

@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 20, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Review skipped — only excluded labels are configured. (1)
  • skip-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: ace49359-a258-47da-9f79-6ea95b9ebc58

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/pr1-remove-inline-features-wrapper
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch refactor/pr1-remove-inline-features-wrapper

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ndycode ndycode added the passed label Mar 20, 2026
@ndycode
Copy link
Owner Author

ndycode commented Mar 23, 2026

Closing because this work is now included in main via #318 and #319.

@ndycode ndycode closed this Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant