First time launch user help to fix "device identity required"#741
First time launch user help to fix "device identity required"#741blacksaturn1 wants to merge 2 commits intoNVIDIA:mainfrom
Conversation
Surface the full dashboard URL (with #token=...) so users can copy-paste it into a browser without hitting the 'device identity required' error. The token is read from the sandbox's openclaw.json via openshell sandbox connect. If the token cannot be read, the bare URL is shown as a fallback. Changes: - bin/lib/runner.js: add readSandboxToken() and getDashboardUrl() helpers - bin/lib/onboard.js: printDashboard() now shows the tokenized Dashboard URL - bin/nemoclaw.js: sandboxStatus() shows the Dashboard URL - install.sh: print_done() shows the Dashboard URL after installation
📝 WalkthroughWalkthroughMultiple scripts now support computed dashboard URLs with optional authentication tokens. A new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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.
🧹 Nitpick comments (1)
install.sh (1)
112-119: Minor: Python path injection edge case with special characters in temp directory.The
$_token_dirvariable is interpolated directly into the Python string literal. Whilemktemptypically returns safe paths, if the path contained a single quote, it would break Python syntax.Consider using stdin to pass the path:
♻️ Safer alternative using stdin
- token="$(python3 -c " -import json, sys -try: - cfg = json.load(open('${_token_dir}/openclaw.json')) - print(cfg.get('gateway',{}).get('auth',{}).get('token','')) -except Exception: - pass -" 2>/dev/null | grep -xE '[0-9a-f]{64}' | head -1)" || token="" + token="$(python3 -c " +import json, sys +try: + cfg = json.load(open(sys.argv[1])) + print(cfg.get('gateway',{}).get('auth',{}).get('token','')) +except Exception: + pass +" "${_token_dir}/openclaw.json" 2>/dev/null | grep -xE '[0-9a-f]{64}' | head -1)" || token=""🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@install.sh` around lines 112 - 119, The current token extraction embeds ${_token_dir} directly into the python3 -c string (the command that sets the token variable), which can break if the temp path contains single quotes; change the invocation so the path is passed via stdin or environment instead of interpolating into the Python literal: keep the token assignment and the python3 -c usage but read the directory path from sys.stdin or os.environ (or accept it as an argument) and open the file '<provided_path>/openclaw.json' inside the Python code, then print the token as before and pipe the script output through the same grep/head checks; update references to the python invocation that currently mentions ${_token_dir} and ensure the fallback || token="" remains.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@install.sh`:
- Around line 112-119: The current token extraction embeds ${_token_dir}
directly into the python3 -c string (the command that sets the token variable),
which can break if the temp path contains single quotes; change the invocation
so the path is passed via stdin or environment instead of interpolating into the
Python literal: keep the token assignment and the python3 -c usage but read the
directory path from sys.stdin or os.environ (or accept it as an argument) and
open the file '<provided_path>/openclaw.json' inside the Python code, then print
the token as before and pipe the script output through the same grep/head
checks; update references to the python invocation that currently mentions
${_token_dir} and ensure the fallback || token="" remains.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 30134e02-79f4-4918-a7eb-01168cc1f562
📒 Files selected for processing (4)
bin/lib/onboard.jsbin/lib/runner.jsbin/nemoclaw.jsinstall.sh
|
Thanks for submitting this PR, it enhances the installation script to make it easier for users to access the dashboard and fixes the 'device identity required' issue, which improves the overall user experience during the setup process. |
Summary
This pull request enhances the installation script by improving how the dashboard URL is displayed to the user. After installation, the script now attempts to retrieve an authentication token from the sandbox's
openclaw.jsonfile and, if successful, appends it to the dashboard URL for easier access.Dashboard authentication improvements:
print_done()function ininstall.shnow tries to read the gateway auth token from the sandbox'sopenclaw.jsonusingopenshelland Python, and includes the token in the dashboard URL if available.Related Issue
Changes
Type of Change
Testing
npx prek run --all-filespasses (or equivalentlymake check).npm testpasses.make docsbuilds without warnings. (for doc-only changes)Checklist
General
Code Changes
npx prek run --all-filesauto-fixes formatting (ormake formatfor targeted runs).Doc Changes
update-docsagent skill to draft changes while complying with the style guide. For example, prompt your agent with "/update-docscatch up the docs for the new changes I made in this PR."Summary by CodeRabbit