fix(onboard): print dashboard URL with auth token on completion#793
fix(onboard): print dashboard URL with auth token on completion#793roselijack wants to merge 1 commit intoNVIDIA:mainfrom
Conversation
📝 WalkthroughWalkthroughAdded functionality to retrieve the OpenClaw dashboard URL with authentication token by executing Changes
Sequence DiagramsequenceDiagram
participant User
participant OnboardScript as Onboard Script
participant SSHProxy as OpenShell SSH
participant Sandbox as Sandbox/OpenClaw
participant Parser as URL Parser
User->>OnboardScript: Complete onboarding
OnboardScript->>OnboardScript: Call getDashboardUrl()
OnboardScript->>SSHProxy: Execute openclaw dashboard<br/>--no-open
SSHProxy->>Sandbox: Run command
Sandbox->>SSHProxy: Return Dashboard URL:<br/>http://127.0.0.1:18789/#token=...
SSHProxy->>OnboardScript: Stdout with URL
OnboardScript->>Parser: Parse Dashboard URL
Parser->>OnboardScript: Extracted URL
alt Success
OnboardScript->>User: Display Dashboard URL
else Failure
OnboardScript->>User: Display Fallback URL
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 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 unit tests (beta)
Comment |
After onboarding, users are told to visit the dashboard but have no way to authenticate — the gateway token was never shown. This caused a confusing loop: visit the URL, get a login prompt, no token in sight. Retrieve the token from inside the sandbox via openshell's ssh-proxy (the same channel used by `nemoclaw <name> connect`) and print the complete dashboard URL — including the #token fragment — in the onboarding summary. Falls back silently to the bare URL if token retrieval fails (e.g. in non-standard environments or when the sandbox gateway hasn't started yet), so the onboarding flow is never blocked. Closes NVIDIA#53
There was a problem hiding this comment.
🧹 Nitpick comments (1)
bin/lib/onboard.js (1)
1064-1069: Consider adding SSH connection timeout to prevent indefinite hangs.If the sandbox becomes unresponsive or there's a network issue, this SSH command could hang indefinitely—frustrating for users who've completed all 7 onboarding steps. Adding a connection timeout ensures the fallback URL is returned promptly.
⏱️ Proposed fix to add timeout
const out = runCapture( - `ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR` + + `ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR -o ConnectTimeout=5` + ` -o "ProxyCommand=${proxyCmd}"` + ` sandbox@${shellQuote(sandboxName)} 'openclaw dashboard --no-open 2>/dev/null'`, { ignoreError: true } );🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@bin/lib/onboard.js` around lines 1064 - 1069, The SSH invocation built for runCapture can hang indefinitely; modify the command constructed where runCapture is called (look for the variables proxyCmd, sandboxName, shellQuote and the const out assignment) to include an SSH connection timeout option (e.g., -o ConnectTimeout=<seconds>) and/or a client-side timeout wrapper so the call returns promptly on network issues; ensure you add the timeout option to the SSH flags string passed to runCapture and keep ignoreError: true unchanged so the existing fallback logic still runs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@bin/lib/onboard.js`:
- Around line 1064-1069: The SSH invocation built for runCapture can hang
indefinitely; modify the command constructed where runCapture is called (look
for the variables proxyCmd, sandboxName, shellQuote and the const out
assignment) to include an SSH connection timeout option (e.g., -o
ConnectTimeout=<seconds>) and/or a client-side timeout wrapper so the call
returns promptly on network issues; ensure you add the timeout option to the SSH
flags string passed to runCapture and keep ignoreError: true unchanged so the
existing fallback logic still runs.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 9057b9a4-8369-444b-8a29-67906d953307
📒 Files selected for processing (1)
bin/lib/onboard.js
|
Closing in favor of #87, which covers the same fix and arrived first with unit tests included. Happy to help review or test over there if useful. |
Problem
After
nemoclaw onboardcompletes, the summary prints the sandbox name and next steps but never shows the dashboard URL or its auth token. Users who navigate tohttp://127.0.0.1:18789/hit a login prompt with no token in sight, creating a circular experience.Reported in #53.
Solution
Add
getDashboardUrl()which SSHes into the sandbox viaopenshell ssh-proxy(the same channel used bynemoclaw <name> connect) and runsopenclaw dashboard --no-opento retrieve the token. The completehttp://127.0.0.1:18789/#token=<hex>URL is then printed in the onboarding summary.Falls back silently to the bare URL if token retrieval fails, so the onboarding flow is never blocked.
Test plan
nemoclaw onboardend-to-end — confirm the summary prints aDashboardline with a#token=fragmentCloses #53
Summary by CodeRabbit