fix(onboard): resolve OpenShell binaries from Apple Silicon Homebrew prefix#5461
fix(onboard): resolve OpenShell binaries from Apple Silicon Homebrew prefix#5461yimoj wants to merge 1 commit into
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.
|
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