Repository navigation
Conversation
📝 WalkthroughWalkthroughThree openshell binary resolvers ( ChangesApple Silicon Homebrew Fallbacks and Gateway Failure Detection
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Suggested reviewers
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)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@src/lib/onboard/docker-driver-gateway-failure.ts`:
- Around line 64-75: The error message in the docker-driver-gateway-failure.ts
function incorrectly assumes the process is still running based on
!childExit.exited being false, but the caller in src/lib/onboard.ts may have
already determined via isPidAlive() that the process is actually not alive. To
fix this, either pass the actual liveness check result from the call site in
src/lib/onboard.ts as a parameter to the function handling this branch, or
re-check the process liveness immediately before reporting the error message.
Use the actual liveness state to report an accurate message that doesn't claim
the gateway is running when it's actually dead.
🪄 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: Enterprise
Run ID: 86989a3e-1378-48de-a1d9-e54a2cb89532
📒 Files selected for processing (6)
src/lib/adapters/openshell/resolve.test.tssrc/lib/adapters/openshell/resolve.tssrc/lib/onboard/docker-driver-gateway-failure.test.tssrc/lib/onboard/docker-driver-gateway-failure.tssrc/lib/onboard/docker-driver-gateway-runtime.test.tssrc/lib/onboard/docker-driver-gateway-runtime.ts
8115ed5 to
b78dcb7
Compare
…prefix On Apple Silicon macOS, Homebrew installs OpenShell under /opt/homebrew/bin, which is frequently absent from the non-interactive onboarding shell's PATH (Homebrew only adds it via `brew shellenv`). The CLI resolver (resolveOpenshell) and the standalone gateway/sandbox resolvers fell back to ~/.local/bin, /usr/local/bin and /usr/bin only, so onboarding reported 'openshell CLI not found' — and could fail the Docker-driver gateway step — even though OpenShell was installed (NVIDIA#5334). - Add /opt/homebrew/bin to the CLI, gateway, and sandbox binary fallbacks so all three resolvers stay coherent. - In the Docker-driver gateway start-failure report, distinguish a crashed gateway from one that is still running but never became healthy, and add `openshell status` / `openshell gateway info` to the troubleshooting footer so the actual cause is discoverable. Validated end-to-end on Apple Silicon macOS 26.5.1 (arm64, Docker via colima) with OpenShell installed only at /opt/homebrew/bin and off PATH: pre-fix `nemoclaw onboard` printed 'openshell CLI not found' and reinstalled; post-fix it resolved the binary and reached '✓ Docker-driver gateway is healthy'. Signed-off-by: Yimo Jiang <yimoj@nvidia.com>
b78dcb7 to
8b0a10d
Compare
|
@coderabbitai Addressed in Rather than thread a
which is accurate whether the process is alive-but-unhealthy or already dead-but-exit-not-yet-observed. The |
|
Tip For best results, initiate chat on the files or code changes.
|
There was a problem hiding this comment.
Approve, looks clean end to end. Verified locally on macOS Apple Silicon, all 31 targeted tests pass (resolve.test.ts, docker-driver-gateway-runtime.test.ts, docker-driver-gateway-failure.test.ts). Resolver order is right (PATH wins first, then user local, then /opt/homebrew/bin, then /usr/local/bin, then /usr/bin), Intel Mac path preserved, and the new wording in the gateway failure diagnostic plus the openshell status / openshell gateway info hints make the misreport class self diagnosing.
|
Hey @yimoj, retracting approval for now. Branch is on your fork so our PR Review Advisor can't run. Mind pushing to NVIDIA/NemoClaw so we can get that signal before merge? Looked clean when I verified locally on Apple Silicon. |
Withdrawing approval pending PR Review Advisor pass; advisor cannot run on fork branches.
|
@cjagwani I don't have write access to this repo. |
|
✨ Thanks for the proposed fix adding Related open issues: |
1 similar comment
|
✨ Thanks for the proposed fix adding Related open issues: |
|
@yimoj You have write access to the repo now :) |
|
Superseded by #5791, opened from NVIDIA/NemoClaw branch so trusted PR advisor workflows can run. |
|
Closing in favor of #5791. |
…prefix (#5791) ## Summary On Apple Silicon macOS, Homebrew installs OpenShell under `/opt/homebrew/bin`, which is frequently missing from the non-interactive onboarding shell's `PATH`. NemoClaw's binary resolvers did not probe that prefix, so onboarding reported `openshell CLI not found` (and could fail the Docker-driver gateway step) even though OpenShell was installed. This adds `/opt/homebrew/bin` to the CLI, gateway, and sandbox resolvers and clarifies the gateway start-failure diagnostic. ## Related Issue Fixes #5334 ## Changes - `src/lib/adapters/openshell/resolve.ts`: add `/opt/homebrew/bin/openshell` to the CLI resolver fallbacks (Apple Silicon Homebrew prefix). - `src/lib/onboard/docker-driver-gateway-runtime.ts`: add `/opt/homebrew/bin/openshell-gateway` and `/opt/homebrew/bin/openshell-sandbox` to the standalone gateway/sandbox fallbacks, keeping all three resolvers coherent. - `src/lib/onboard/docker-driver-gateway-failure.ts`: distinguish a crashed gateway from one that did not become healthy in time (state-agnostic wording), and add `openshell status` / `openshell gateway info` to the troubleshooting footer so the real cause is discoverable instead of only "failed to start". - Tests for the `/opt/homebrew/bin` fallback (CLI + gateway + sandbox) and the gateway start-failure diagnostic. ## Type of Change - [x] Code change (feature, bug fix, or refactor) ## Verification - [x] Git hooks passed during commit and push - [x] Targeted tests pass for changed behavior (`resolve.test.ts`, `docker-driver-gateway-runtime.test.ts`, `docker-driver-gateway-failure.test.ts` — 31 tests) - [x] Tests added or updated for new or changed behavior - [x] No secrets, API keys, or credentials committed `src/lib/onboard.ts` is untouched (net-neutral, no growth-guardrail impact). ### End-to-end on the reporter's platform (real worktree CLI) Run on **Apple Silicon macOS 26.5.1 (arm64), Docker via colima**, against the built worktree CLI (`node ./bin/nemoclaw.js`). The reporter's condition was recreated exactly: OpenShell 0.0.44 installed **only at `/opt/homebrew/bin`**, with that prefix **absent from the onboarding shell's `PATH`** (so `command -v openshell` fails, as in a non-interactive Homebrew shell). **Before the fix** — onboarding cannot find the installed OpenShell: ```console $ export PATH="$HOME/repro-bin:/usr/bin:/bin:/usr/sbin:/sbin" # /opt/homebrew/bin intentionally NOT on PATH $ command -v openshell # (not found — openshell lives only at /opt/homebrew/bin) $ node ./bin/nemoclaw.js onboard --non-interactive --name repro-5334 [1/8] Preflight checks ✓ Container runtime: colima openshell CLI not found. Installing... [install] Detected macOS (aarch64) [install] Installed openshell to /Users/yimoj/.local/bin/openshell (user-local path) ``` **After the fix** — identical setup; the resolver finds the Homebrew binary and the gateway step (the one that failed for the reporter) passes: ```console $ command -v openshell # (still not found on PATH — unchanged) $ node ./bin/nemoclaw.js onboard --non-interactive --name repro-5334 [1/8] Preflight checks ✓ Container runtime: colima ✓ openshell CLI: openshell 0.0.44 [2/8] Starting OpenShell gateway Starting OpenShell Docker-driver gateway... ✓ Docker-driver gateway is healthy [3/8] Configuring inference provider NVIDIA_INFERENCE_API_KEY (or NEMOCLAW_PROVIDER_KEY) is required for NVIDIA Endpoints in non-interactive mode. ``` After the fix, onboarding resolves OpenShell directly at `/opt/homebrew/bin` (no "not found", no redundant reinstall) and reaches `✓ Docker-driver gateway is healthy`, advancing past the failing step. It then stops only on a missing `NVIDIA_INFERENCE_API_KEY`, which is unrelated to this bug. Note: GitHub-hosted macOS runners (`.github/workflows/macos-e2e.yaml`) have no Docker, so this Docker-driver flow can only be validated on a Docker-capable Apple Silicon Mac, as done above. --- Signed-off-by: Yimo Jiang <yimoj@nvidia.com> --- Supersedes #5461 (reopened from NVIDIA/NemoClaw branch so trusted advisor workflows can run). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved binary detection on macOS Apple Silicon by checking the Homebrew location first, helping the app find the right executables more reliably. * Refined failure messages and troubleshooting hints so users see more accurate guidance when startup issues occur. * Added extra diagnostics to help with gateway-related troubleshooting. * **Tests** * Expanded test coverage for macOS/Homebrew fallback behavior and error-message handling. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Yimo Jiang <yimoj@nvidia.com> Co-authored-by: cjagwani <cjagwani@nvidia.com>
…prefix (NVIDIA#5791) ## Summary On Apple Silicon macOS, Homebrew installs OpenShell under `/opt/homebrew/bin`, which is frequently missing from the non-interactive onboarding shell's `PATH`. NemoClaw's binary resolvers did not probe that prefix, so onboarding reported `openshell CLI not found` (and could fail the Docker-driver gateway step) even though OpenShell was installed. This adds `/opt/homebrew/bin` to the CLI, gateway, and sandbox resolvers and clarifies the gateway start-failure diagnostic. ## Related Issue Fixes NVIDIA#5334 ## Changes - `src/lib/adapters/openshell/resolve.ts`: add `/opt/homebrew/bin/openshell` to the CLI resolver fallbacks (Apple Silicon Homebrew prefix). - `src/lib/onboard/docker-driver-gateway-runtime.ts`: add `/opt/homebrew/bin/openshell-gateway` and `/opt/homebrew/bin/openshell-sandbox` to the standalone gateway/sandbox fallbacks, keeping all three resolvers coherent. - `src/lib/onboard/docker-driver-gateway-failure.ts`: distinguish a crashed gateway from one that did not become healthy in time (state-agnostic wording), and add `openshell status` / `openshell gateway info` to the troubleshooting footer so the real cause is discoverable instead of only "failed to start". - Tests for the `/opt/homebrew/bin` fallback (CLI + gateway + sandbox) and the gateway start-failure diagnostic. ## Type of Change - [x] Code change (feature, bug fix, or refactor) ## Verification - [x] Git hooks passed during commit and push - [x] Targeted tests pass for changed behavior (`resolve.test.ts`, `docker-driver-gateway-runtime.test.ts`, `docker-driver-gateway-failure.test.ts` — 31 tests) - [x] Tests added or updated for new or changed behavior - [x] No secrets, API keys, or credentials committed `src/lib/onboard.ts` is untouched (net-neutral, no growth-guardrail impact). ### End-to-end on the reporter's platform (real worktree CLI) Run on **Apple Silicon macOS 26.5.1 (arm64), Docker via colima**, against the built worktree CLI (`node ./bin/nemoclaw.js`). The reporter's condition was recreated exactly: OpenShell 0.0.44 installed **only at `/opt/homebrew/bin`**, with that prefix **absent from the onboarding shell's `PATH`** (so `command -v openshell` fails, as in a non-interactive Homebrew shell). **Before the fix** — onboarding cannot find the installed OpenShell: ```console $ export PATH="$HOME/repro-bin:/usr/bin:/bin:/usr/sbin:/sbin" # /opt/homebrew/bin intentionally NOT on PATH $ command -v openshell # (not found — openshell lives only at /opt/homebrew/bin) $ node ./bin/nemoclaw.js onboard --non-interactive --name repro-5334 [1/8] Preflight checks ✓ Container runtime: colima openshell CLI not found. Installing... [install] Detected macOS (aarch64) [install] Installed openshell to /Users/yimoj/.local/bin/openshell (user-local path) ``` **After the fix** — identical setup; the resolver finds the Homebrew binary and the gateway step (the one that failed for the reporter) passes: ```console $ command -v openshell # (still not found on PATH — unchanged) $ node ./bin/nemoclaw.js onboard --non-interactive --name repro-5334 [1/8] Preflight checks ✓ Container runtime: colima ✓ openshell CLI: openshell 0.0.44 [2/8] Starting OpenShell gateway Starting OpenShell Docker-driver gateway... ✓ Docker-driver gateway is healthy [3/8] Configuring inference provider NVIDIA_INFERENCE_API_KEY (or NEMOCLAW_PROVIDER_KEY) is required for NVIDIA Endpoints in non-interactive mode. ``` After the fix, onboarding resolves OpenShell directly at `/opt/homebrew/bin` (no "not found", no redundant reinstall) and reaches `✓ Docker-driver gateway is healthy`, advancing past the failing step. It then stops only on a missing `NVIDIA_INFERENCE_API_KEY`, which is unrelated to this bug. Note: GitHub-hosted macOS runners (`.github/workflows/macos-e2e.yaml`) have no Docker, so this Docker-driver flow can only be validated on a Docker-capable Apple Silicon Mac, as done above. --- Signed-off-by: Yimo Jiang <yimoj@nvidia.com> --- Supersedes NVIDIA#5461 (reopened from NVIDIA/NemoClaw branch so trusted advisor workflows can run). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved binary detection on macOS Apple Silicon by checking the Homebrew location first, helping the app find the right executables more reliably. * Refined failure messages and troubleshooting hints so users see more accurate guidance when startup issues occur. * Added extra diagnostics to help with gateway-related troubleshooting. * **Tests** * Expanded test coverage for macOS/Homebrew fallback behavior and error-message handling. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Yimo Jiang <yimoj@nvidia.com> Co-authored-by: cjagwani <cjagwani@nvidia.com>
Summary
On Apple Silicon macOS, Homebrew installs OpenShell under
/opt/homebrew/bin, which is frequently missing from the non-interactive onboarding shell'sPATH. NemoClaw's binary resolvers did not probe that prefix, so onboarding reportedopenshell CLI not found(and could fail the Docker-driver gateway step) even though OpenShell was installed. This adds/opt/homebrew/binto the CLI, gateway, and sandbox resolvers and clarifies the gateway start-failure diagnostic.Related Issue
Fixes #5334
Changes
src/lib/adapters/openshell/resolve.ts: add/opt/homebrew/bin/openshellto the CLI resolver fallbacks (Apple Silicon Homebrew prefix).src/lib/onboard/docker-driver-gateway-runtime.ts: add/opt/homebrew/bin/openshell-gatewayand/opt/homebrew/bin/openshell-sandboxto the standalone gateway/sandbox fallbacks, keeping all three resolvers coherent.src/lib/onboard/docker-driver-gateway-failure.ts: distinguish a crashed gateway from one that did not become healthy in time (state-agnostic wording), and addopenshell status/openshell gateway infoto the troubleshooting footer so the real cause is discoverable instead of only "failed to start"./opt/homebrew/binfallback (CLI + gateway + sandbox) and the gateway start-failure diagnostic.Type of Change
Verification
resolve.test.ts,docker-driver-gateway-runtime.test.ts,docker-driver-gateway-failure.test.ts— 31 tests)src/lib/onboard.tsis untouched (net-neutral, no growth-guardrail impact).End-to-end on the reporter's platform (real worktree CLI)
Run on Apple Silicon macOS 26.5.1 (arm64), Docker via colima, against the built worktree CLI (
node ./bin/nemoclaw.js). The reporter's condition was recreated exactly: OpenShell 0.0.44 installed only at/opt/homebrew/bin, with that prefix absent from the onboarding shell'sPATH(socommand -v openshellfails, as in a non-interactive Homebrew shell).Before the fix — onboarding cannot find the installed OpenShell:
After the fix — identical setup; the resolver finds the Homebrew binary and the gateway step (the one that failed for the reporter) passes:
After the fix, onboarding resolves OpenShell directly at
/opt/homebrew/bin(no "not found", no redundant reinstall) and reaches✓ Docker-driver gateway is healthy, advancing past the failing step. It then stops only on a missingNVIDIA_INFERENCE_API_KEY, which is unrelated to this bug.Note: GitHub-hosted macOS runners (
.github/workflows/macos-e2e.yaml) have no Docker, so this Docker-driver flow can only be validated on a Docker-capable Apple Silicon Mac, as done above.Signed-off-by: Yimo Jiang yimoj@nvidia.com