Fix factory CLI top-level commands#17
Conversation
|
Warning Review limit reached
More reviews will be available in 55 minutes and 21 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughFactory actions ( ChangesFlatten factory command namespace
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Code Review
This pull request flattens the CLI command structure by removing the nested factory subcommand namespace. Factory actions (such as run-once, start, and status) are promoted to top-level commands under the factory CLI, while fleet-related commands are nested under a new fleet subcommand (e.g., factory fleet spawn). The documentation, tests, and helper scripts have been updated accordingly. There are no review comments, so I have no additional feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
2e33354 to
965b116
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/cli/fleet.ts (1)
646-659: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winCentralize factory action names to prevent routing/help drift.
isFactoryAction()andusage()both hardcode the action list; future additions can easily update one but miss the other, making valid actions unreachable or undocumented.♻️ Proposed refactor
+const FACTORY_ACTIONS = [ + 'start', + 'run-once', + 'loop', + 'status', + 'loop-status', + 'kill-loop', + 'reap-orphans', + 'canary', + 'triage', + 'dispatch', + 'close-probe', +] as const + function isFactoryAction(value: string): boolean { - return value === 'start' || - value === 'run-once' || - value === 'loop' || - value === 'status' || - value === 'loop-status' || - value === 'kill-loop' || - value === 'reap-orphans' || - value === 'canary' || - value === 'triage' || - value === 'dispatch' || - value === 'close-probe' + return (FACTORY_ACTIONS as readonly string[]).includes(value) } function usage(): string { - return 'usage: factory <run-once|start|status|loop|loop-status|kill-loop|reap-orphans|canary|triage|dispatch|close-probe|fleet> [options]' + return `usage: factory <${[...FACTORY_ACTIONS, 'fleet'].join('|')}> [options]` }Also applies to: 715-715
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/cli/fleet.ts` around lines 646 - 659, The isFactoryAction() function and usage() function both hardcode the same list of factory actions, creating maintenance drift where adding a new action to one place can easily be forgotten in the other. Create a centralized constant array containing all valid factory action names at the module level, then refactor isFactoryAction() to check if the input value is included in this constant, and update the usage() function to reference the same constant when displaying available actions. This ensures any future action additions only need to be made in one place.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/cli/fleet.ts`:
- Around line 646-659: The isFactoryAction() function and usage() function both
hardcode the same list of factory actions, creating maintenance drift where
adding a new action to one place can easily be forgotten in the other. Create a
centralized constant array containing all valid factory action names at the
module level, then refactor isFactoryAction() to check if the input value is
included in this constant, and update the usage() function to reference the same
constant when displaying available actions. This ensures any future action
additions only need to be made in one place.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1bbcb122-6000-4d3e-b2b2-fdbfa0b5285e
📒 Files selected for processing (5)
README.mdbin/fleet.mjsscripts/factory-canary.shsrc/cli/fleet.test.tssrc/cli/fleet.ts
Summary
factorybinary (run-once,start,status, etc.)fleetnamespace while preserving the localbin/fleet.mjsUXCloses #15.
Validation
npm run buildnpm testnode bin/factory.mjs run-once --dry-run --config test/fixtures/factory.config.jsonnode bin/factory.mjs factory run-once --dry-run --config test/fixtures/factory.config.jsonexits 1 withUnknown factory command: factory