Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdded SPDX header and a Quick Hint to README about stopping a running OpenClaw that may occupy port 18789; updated Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@README.md`:
- Around line 96-126: README.md is missing the required SPDX license header; add
the SPDX header as an HTML comment at the very top of README.md (so it appears
before any Markdown content) using the project's required SPDX token (e.g., <!--
SPDX-License-Identifier: <LICENSE> -->) to satisfy the rule for Markdown files
and ensure all touched docs include the header.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ab2e21c1-077b-40dc-9b86-badb6d17996d
📒 Files selected for processing (2)
README.mdbin/lib/onboard.js
…NVIDIA#1067) On macOS, the onboard preflight port-conflict message suggested 'systemctl --user stop openclaw-gateway.service', which does not exist on macOS. This commit adds a process.platform check so macOS users see the correct launchctl commands instead. Changes: - Add OPENCLAW_LAUNCH_AGENT_PLIST constant in onboard.js - Show launchctl list/unload commands on darwin, systemctl on Linux - Include launchctl list column explanation (PID | ExitStatus | Label) - Show modern bootout alternative alongside legacy unload - Add 'Quick Hint' README section for stopping OpenClaw on both platforms Fixes NVIDIA#1067
1680981 to
254d56e
Compare
## Summary - restore the dashboard forward on all onboarding paths, including existing-sandbox reuse - bind the dashboard forward to `0.0.0.0:18789` only when `CHAT_UI_URL` points at a non-loopback host - show `launchctl` guidance on macOS instead of `systemctl` for dashboard port conflicts - add regression coverage for dashboard bind resolution, sandbox reuse, and platform-specific port-help output ## Issues - Closes #957 - Fixes #1067 - Addresses #1088 ## Why Current onboarding only restored the dashboard forward on the full sandbox-create path. If onboarding reused an existing ready sandbox, the flow returned early and left the dashboard unreachable when the forward was missing. The port-conflict help text also still showed Linux `systemctl` guidance on macOS. ## Implementation - added `isLoopbackHostname(...)`, `resolveDashboardForwardTarget(...)`, and `ensureDashboardForward(...)` in `bin/lib/onboard.js` - reused that helper in both: - the normal sandbox-create success path - the existing ready sandbox reuse path - kept loopback binding for localhost / 127.0.0.0/8 / ::1 - switched to `0.0.0.0:18789` only for explicit non-loopback `CHAT_UI_URL` targets - added `getPortConflictServiceHints(...)` so preflight output stays platform-specific without duplicating logic ## Validation ```bash npx vitest run test/onboard.test.js npx eslint bin/lib/onboard.js test/onboard.test.js npx tsc -p jsconfig.json --noEmit npx vitest run ``` Results: - targeted onboarding suite: passed - ESLint: passed - TypeScript: passed - full Vitest suite: `39` files passed, `680` tests passed, `3` skipped ### Cross-platform validation Validated PR `#1192` / commit `4ef7a07` on: - `mac` - passed - commands: - `npx vitest run test/onboard.test.js` - `npx eslint bin/lib/onboard.js test/onboard.test.js` - `npx tsc -p jsconfig.json --noEmit` - `brev-cpu` (`kj-nemoclaw-cpu-test`) - passed - used Node `v22.22.2` from `~/.nvm` - ran in a disposable worktree with fresh dev dependency install - `brev-gpu` (`kj-nemoclaw-l40s-test`) - passed - used Node `v22.22.1` from `~/.nvm` - ran in a disposable worktree with fresh dev dependency install - one initial timeout occurred on the long-running “create stream never closes” test; immediate rerun passed cleanly - `spark` (`spark-d8c8`) - passed - used Node `v22.22.1` - ran in a disposable worktree with fresh dev dependency install Remote commands used: ```bash npx vitest run test/onboard.test.js npx eslint bin/lib/onboard.js test/onboard.test.js npx tsc -p jsconfig.json --noEmit ``` Environment notes: - Brev CPU/GPU already had usable Node 22 installs, but not on the default shell `PATH` - Spark needed a disposable `npm install --include=dev` because the base checkout did not have the full JS dev toolchain ## Related prior work This PR pulls in the good ideas, but reimplements them cleanly on top of current `main`. Credit to: - `WuKongAI-CMU` / Peter for the dashboard-forward direction in #958 - `dinuduke` / Dinesh Singh for the macOS launchctl guidance direction in #1167 - `latenighthackathon` for the already-merged sudo/lsof fix in #1073, which this PR preserves while making the service hint platform-specific Signed-off-by: Kevin Jones <[email protected]> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Platform-specific port-conflict guidance with OS-appropriate service-stop instructions for macOS and Linux. * Smarter dashboard port forwarding: onboarding now ensures the dashboard binds to loopback or to all interfaces based on the chat UI URL, and restores forwarding when reusing an existing sandbox. * **Tests** * Expanded coverage for port-conflict hints, loopback detection, forward-target resolution, and dashboard-forward behavior across sandbox scenarios. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Summary - restore the dashboard forward on all onboarding paths, including existing-sandbox reuse - bind the dashboard forward to `0.0.0.0:18789` only when `CHAT_UI_URL` points at a non-loopback host - show `launchctl` guidance on macOS instead of `systemctl` for dashboard port conflicts - add regression coverage for dashboard bind resolution, sandbox reuse, and platform-specific port-help output ## Issues - Closes #957 - Fixes #1067 - Addresses #1088 ## Why Current onboarding only restored the dashboard forward on the full sandbox-create path. If onboarding reused an existing ready sandbox, the flow returned early and left the dashboard unreachable when the forward was missing. The port-conflict help text also still showed Linux `systemctl` guidance on macOS. ## Implementation - added `isLoopbackHostname(...)`, `resolveDashboardForwardTarget(...)`, and `ensureDashboardForward(...)` in `bin/lib/onboard.js` - reused that helper in both: - the normal sandbox-create success path - the existing ready sandbox reuse path - kept loopback binding for localhost / 127.0.0.0/8 / ::1 - switched to `0.0.0.0:18789` only for explicit non-loopback `CHAT_UI_URL` targets - added `getPortConflictServiceHints(...)` so preflight output stays platform-specific without duplicating logic ## Validation ```bash npx vitest run test/onboard.test.js npx eslint bin/lib/onboard.js test/onboard.test.js npx tsc -p jsconfig.json --noEmit npx vitest run ``` Results: - targeted onboarding suite: passed - ESLint: passed - TypeScript: passed - full Vitest suite: `39` files passed, `680` tests passed, `3` skipped ### Cross-platform validation Validated PR `#1192` / commit `4ef7a07` on: - `mac` - passed - commands: - `npx vitest run test/onboard.test.js` - `npx eslint bin/lib/onboard.js test/onboard.test.js` - `npx tsc -p jsconfig.json --noEmit` - `brev-cpu` (`kj-nemoclaw-cpu-test`) - passed - used Node `v22.22.2` from `~/.nvm` - ran in a disposable worktree with fresh dev dependency install - `brev-gpu` (`kj-nemoclaw-l40s-test`) - passed - used Node `v22.22.1` from `~/.nvm` - ran in a disposable worktree with fresh dev dependency install - one initial timeout occurred on the long-running “create stream never closes” test; immediate rerun passed cleanly - `spark` (`spark-d8c8`) - passed - used Node `v22.22.1` - ran in a disposable worktree with fresh dev dependency install Remote commands used: ```bash npx vitest run test/onboard.test.js npx eslint bin/lib/onboard.js test/onboard.test.js npx tsc -p jsconfig.json --noEmit ``` Environment notes: - Brev CPU/GPU already had usable Node 22 installs, but not on the default shell `PATH` - Spark needed a disposable `npm install --include=dev` because the base checkout did not have the full JS dev toolchain ## Related prior work This PR pulls in the good ideas, but reimplements them cleanly on top of current `main`. Credit to: - `WuKongAI-CMU` / Peter for the dashboard-forward direction in #958 - `dinuduke` / Dinesh Singh for the macOS launchctl guidance direction in #1167 - `latenighthackathon` for the already-merged sudo/lsof fix in #1073, which this PR preserves while making the service hint platform-specific Signed-off-by: Kevin Jones <[email protected]> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Platform-specific port-conflict guidance with OS-appropriate service-stop instructions for macOS and Linux. * Smarter dashboard port forwarding: onboarding now ensures the dashboard binds to loopback or to all interfaces based on the chat UI URL, and restores forwarding when reusing an existing sandbox. * **Tests** * Expanded coverage for port-conflict hints, loopback detection, forward-target resolution, and dashboard-forward behavior across sandbox scenarios. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
…#1192) ## Summary - restore the dashboard forward on all onboarding paths, including existing-sandbox reuse - bind the dashboard forward to `0.0.0.0:18789` only when `CHAT_UI_URL` points at a non-loopback host - show `launchctl` guidance on macOS instead of `systemctl` for dashboard port conflicts - add regression coverage for dashboard bind resolution, sandbox reuse, and platform-specific port-help output ## Issues - Closes NVIDIA#957 - Fixes NVIDIA#1067 - Addresses NVIDIA#1088 ## Why Current onboarding only restored the dashboard forward on the full sandbox-create path. If onboarding reused an existing ready sandbox, the flow returned early and left the dashboard unreachable when the forward was missing. The port-conflict help text also still showed Linux `systemctl` guidance on macOS. ## Implementation - added `isLoopbackHostname(...)`, `resolveDashboardForwardTarget(...)`, and `ensureDashboardForward(...)` in `bin/lib/onboard.js` - reused that helper in both: - the normal sandbox-create success path - the existing ready sandbox reuse path - kept loopback binding for localhost / 127.0.0.0/8 / ::1 - switched to `0.0.0.0:18789` only for explicit non-loopback `CHAT_UI_URL` targets - added `getPortConflictServiceHints(...)` so preflight output stays platform-specific without duplicating logic ## Validation ```bash npx vitest run test/onboard.test.js npx eslint bin/lib/onboard.js test/onboard.test.js npx tsc -p jsconfig.json --noEmit npx vitest run ``` Results: - targeted onboarding suite: passed - ESLint: passed - TypeScript: passed - full Vitest suite: `39` files passed, `680` tests passed, `3` skipped ### Cross-platform validation Validated PR `NVIDIA#1192` / commit `4ef7a07` on: - `mac` - passed - commands: - `npx vitest run test/onboard.test.js` - `npx eslint bin/lib/onboard.js test/onboard.test.js` - `npx tsc -p jsconfig.json --noEmit` - `brev-cpu` (`kj-nemoclaw-cpu-test`) - passed - used Node `v22.22.2` from `~/.nvm` - ran in a disposable worktree with fresh dev dependency install - `brev-gpu` (`kj-nemoclaw-l40s-test`) - passed - used Node `v22.22.1` from `~/.nvm` - ran in a disposable worktree with fresh dev dependency install - one initial timeout occurred on the long-running “create stream never closes” test; immediate rerun passed cleanly - `spark` (`spark-d8c8`) - passed - used Node `v22.22.1` - ran in a disposable worktree with fresh dev dependency install Remote commands used: ```bash npx vitest run test/onboard.test.js npx eslint bin/lib/onboard.js test/onboard.test.js npx tsc -p jsconfig.json --noEmit ``` Environment notes: - Brev CPU/GPU already had usable Node 22 installs, but not on the default shell `PATH` - Spark needed a disposable `npm install --include=dev` because the base checkout did not have the full JS dev toolchain ## Related prior work This PR pulls in the good ideas, but reimplements them cleanly on top of current `main`. Credit to: - `WuKongAI-CMU` / Peter for the dashboard-forward direction in NVIDIA#958 - `dinuduke` / Dinesh Singh for the macOS launchctl guidance direction in NVIDIA#1167 - `latenighthackathon` for the already-merged sudo/lsof fix in NVIDIA#1073, which this PR preserves while making the service hint platform-specific Signed-off-by: Kevin Jones <[email protected]> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Platform-specific port-conflict guidance with OS-appropriate service-stop instructions for macOS and Linux. * Smarter dashboard port forwarding: onboarding now ensures the dashboard binds to loopback or to all interfaces based on the chat UI URL, and restores forwarding when reusing an existing sandbox. * **Tests** * Expanded coverage for port-conflict hints, loopback detection, forward-target resolution, and dashboard-forward behavior across sandbox scenarios. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
|
I attempted to port this branch across the JS→TS migration and merge the latest Please start with: git fetch origin
git merge origin/main
npx tsx scripts/ts-migration-assist.ts --base origin/main --write
npm run build:cli
npm run typecheck:cli
npm run lint
npm test |
…#1192) ## Summary - restore the dashboard forward on all onboarding paths, including existing-sandbox reuse - bind the dashboard forward to `0.0.0.0:18789` only when `CHAT_UI_URL` points at a non-loopback host - show `launchctl` guidance on macOS instead of `systemctl` for dashboard port conflicts - add regression coverage for dashboard bind resolution, sandbox reuse, and platform-specific port-help output ## Issues - Closes NVIDIA#957 - Fixes NVIDIA#1067 - Addresses NVIDIA#1088 ## Why Current onboarding only restored the dashboard forward on the full sandbox-create path. If onboarding reused an existing ready sandbox, the flow returned early and left the dashboard unreachable when the forward was missing. The port-conflict help text also still showed Linux `systemctl` guidance on macOS. ## Implementation - added `isLoopbackHostname(...)`, `resolveDashboardForwardTarget(...)`, and `ensureDashboardForward(...)` in `bin/lib/onboard.js` - reused that helper in both: - the normal sandbox-create success path - the existing ready sandbox reuse path - kept loopback binding for localhost / 127.0.0.0/8 / ::1 - switched to `0.0.0.0:18789` only for explicit non-loopback `CHAT_UI_URL` targets - added `getPortConflictServiceHints(...)` so preflight output stays platform-specific without duplicating logic ## Validation ```bash npx vitest run test/onboard.test.js npx eslint bin/lib/onboard.js test/onboard.test.js npx tsc -p jsconfig.json --noEmit npx vitest run ``` Results: - targeted onboarding suite: passed - ESLint: passed - TypeScript: passed - full Vitest suite: `39` files passed, `680` tests passed, `3` skipped ### Cross-platform validation Validated PR `NVIDIA#1192` / commit `4ef7a07` on: - `mac` - passed - commands: - `npx vitest run test/onboard.test.js` - `npx eslint bin/lib/onboard.js test/onboard.test.js` - `npx tsc -p jsconfig.json --noEmit` - `brev-cpu` (`kj-nemoclaw-cpu-test`) - passed - used Node `v22.22.2` from `~/.nvm` - ran in a disposable worktree with fresh dev dependency install - `brev-gpu` (`kj-nemoclaw-l40s-test`) - passed - used Node `v22.22.1` from `~/.nvm` - ran in a disposable worktree with fresh dev dependency install - one initial timeout occurred on the long-running “create stream never closes” test; immediate rerun passed cleanly - `spark` (`spark-d8c8`) - passed - used Node `v22.22.1` - ran in a disposable worktree with fresh dev dependency install Remote commands used: ```bash npx vitest run test/onboard.test.js npx eslint bin/lib/onboard.js test/onboard.test.js npx tsc -p jsconfig.json --noEmit ``` Environment notes: - Brev CPU/GPU already had usable Node 22 installs, but not on the default shell `PATH` - Spark needed a disposable `npm install --include=dev` because the base checkout did not have the full JS dev toolchain ## Related prior work This PR pulls in the good ideas, but reimplements them cleanly on top of current `main`. Credit to: - `WuKongAI-CMU` / Peter for the dashboard-forward direction in NVIDIA#958 - `dinuduke` / Dinesh Singh for the macOS launchctl guidance direction in NVIDIA#1167 - `latenighthackathon` for the already-merged sudo/lsof fix in NVIDIA#1073, which this PR preserves while making the service hint platform-specific Signed-off-by: Kevin Jones <[email protected]> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Platform-specific port-conflict guidance with OS-appropriate service-stop instructions for macOS and Linux. * Smarter dashboard port forwarding: onboarding now ensures the dashboard binds to loopback or to all interfaces based on the chat UI URL, and restores forwarding when reusing an existing sandbox. * **Tests** * Expanded coverage for port-conflict hints, loopback detection, forward-target resolution, and dashboard-forward behavior across sandbox scenarios. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
|
@dinuduke can you add a DCO and resolve the merge conflicts, please? |
|
Thanks @dinuduke for the contribution here. This PR correctly identified that macOS users should see launchctl guidance rather than Linux systemctl guidance when resolving the OpenClaw/NemoClaw port conflict. We have since landed the fix in #1192, which resolved #1067 by restoring the dashboard forward behavior and adding tested platform-specific macOS port guidance in the onboarding path. Since the current main implementation supersedes this earlier branch, I am closing this PR as superseded rather than rejected on merit. |
Summary
Fixes #1067 — macOS users were shown
systemctl --user stop openclaw-gateway.serviceduringnemoclaw onboardpreflight, but macOS does not have systemctl. The correct tool islaunchctl.Changes
bin/lib/onboard.jsOPENCLAW_LAUNCH_AGENT_PLISTconstant for the plist pathprocess.platform === "darwin"check in the port-conflict messagelaunchctl list | grep -i clawwith column explanation (PID | ExitStatus | Label)launchctl unload ~/Library/LaunchAgents/ai.openclaw.gateway.plistlaunchctl bootout gui/$(id -u)/ai.openclaw.gatewaysystemctlinstructionsREADME.mdTesting
node -c bin/lib/onboard.js— syntax validation passeslaunchctlcommands match the exact fix the issue author used successfullyRelated
Summary by CodeRabbit
Documentation
Improvements