Conversation
📝 WalkthroughWalkthroughAdds a new local startup CLI ( ChangesLocal Development Startup
Sequence DiagramsequenceDiagram
actor User
participant CLI as start-local.mjs
participant Env as Repo/Node Validator
participant Deps as Dependency Installer
participant DB as Project Initializer
participant Reg as Registry Manager
participant Net as Port Probe
participant Dev as dev-with-memory.mjs
User->>CLI: run `pnpm local [--engine]`
CLI->>CLI: parse flags
CLI->>Env: verify repo layout & Node >= 22.5
CLI->>Deps: ensure node_modules (or skip)
CLI->>DB: init local project DB if missing
CLI->>Reg: register/activate project (unless skipped)
CLI->>Net: probe/select available port (handle 4040 rule)
CLI->>CLI: build dashboard args (dev/paused/no-auth)
CLI->>User: print startup summary
CLI->>Dev: spawn `dev-with-memory.mjs` with args
Dev->>User: dashboard/API serving locally
Estimated code review effort🎯 4 (Complex) | ⏱️ ~40 minutes 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 docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
Greptile Summary
Confidence Score: 5/5Safe to merge; all findings are P2 suggestions with no runtime-breaking defects. Only P2 issues found (narrow security warning scope, no validation for mutually exclusive flags). The core startup logic, port probing, signal propagation, and project registration are all correct. scripts/start-local.mjs — auth warning condition and flag conflict validation Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A([pnpm local]) --> B[parseArgs]
B --> C{--help?}
C -- yes --> D([print HELP & exit])
C -- no --> E[ensureRepoRoot]
E --> F[ensureNodeVersion]
F --> G{node_modules exists?}
G -- no & skipInstall --> H([fail])
G -- no --> I[pnpm install --frozen-lockfile]
G -- yes --> J[ensureProjectInitialized]
I --> J
J --> K{.fusion/fusion.db?}
K -- no --> L[fn init --name name]
K -- yes --> M[ensureProjectRegistered]
L --> M
M --> N[tsx --eval CentralCore helper]
N --> O[pickPort]
O --> P{port free?}
P -- no, try next --> O
P -- yes --> Q[build dashboardArgs]
Q --> R{--no-auth on external host?}
R -- warn --> S[printSummary]
R -- ok --> S
S --> T{--dry-run?}
T -- yes --> U([exit])
T -- no --> V[spawn node dev-with-memory.mjs]
V --> W([child exits → re-propagate code/signal])
Reviews (2): Last reviewed commit: "fix(FN-000): address local startup revie..." | Re-trigger Greptile |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
scripts/start-local.mjs (1)
203-268: 💤 Low valueLGTM with one suggestion.
The inline script is well-structured with proper
try/finallycleanup and safe string interpolation viaJSON.stringify.One note: Line 254 silently swallows errors from
ensureMemoryFileWithBackend. Consider at least logging a warning if this fails, as it could hide setup issues that are confusing to debug later.Optional: Log a warning on memory file setup failure
- await ensureMemoryFileWithBackend(root).catch(() => false); + await ensureMemoryFileWithBackend(root).catch((err) => { + console.warn("Memory file setup skipped: " + (err instanceof Error ? err.message : String(err))); + });🤖 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 `@scripts/start-local.mjs` around lines 203 - 268, In ensureProjectRegistered, the helper currently swallows errors from ensureMemoryFileWithBackend with .catch(() => false); change that to log a warning including the error (use console.warn or processLogger) so failures to set up the memory file are visible; update the inline helper string (the main() function inside the helper) to catch the error from ensureMemoryFileWithBackend(root) and emit a descriptive warning mentioning ensureMemoryFileWithBackend and the error before continuing.
🤖 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 `@scripts/start-local.mjs`:
- Around line 203-268: In ensureProjectRegistered, the helper currently swallows
errors from ensureMemoryFileWithBackend with .catch(() => false); change that to
log a warning including the error (use console.warn or processLogger) so
failures to set up the memory file are visible; update the inline helper string
(the main() function inside the helper) to catch the error from
ensureMemoryFileWithBackend(root) and emit a descriptive warning mentioning
ensureMemoryFileWithBackend and the error before continuing.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 9dff045d-ab10-466f-80a3-55444602e1d5
📒 Files selected for processing (2)
package.jsonscripts/start-local.mjs
🚧 Files skipped from review as they are similar to previous changes (1)
- package.json
Summary
Adds a repo-level
pnpm localstartup wrapper for local development.The script keeps the default path simple and conservative:
--engineis passedAlso documents the new commands in the README development section.
Validation
Ran:
pnpm exec eslint scripts/start-local.mjspnpm local -- --dry-run --port 4040pnpm local -- --port 4057curl http://localhost:4057/curl http://localhost:4057/api/healthcurl http://localhost:4057/api/taskspnpm verify:workspacewas started after rebasing onto currentmain; lint passed and the suite progressed through multiple packages, but the full gate was intentionally stopped at the user's request to avoid waiting on the whole workspace run for this small dev-tooling change.Notes
During local startup, existing upstream runtime warnings were observed but did not block serving the app/API:
Summary by CodeRabbit
pnpm localcommand to start the local dashboard and API for development.pnpm local -- --enginecommand to start the local dashboard with the AI engine enabled.