Repository navigation
fix(rebuild): keep the recorded OpenClaw dashboard origin - #13198
Conversation
Rebuild reset OpenClaw gateway.controlUi.allowedOrigins to loopback because the managed replacement profile and the custom-image recreate path hardcoded http://127.0.0.1:<port>. Replay the registry's dashboardExternalUrl instead, falling back to the previous profile's external URL for older records, and rebind it to the replacement dashboard port. An exported CHAT_UI_URL during rebuild is ignored with an explicit warning that names how to change the origin. --control-ui-port now selects only the port and keeps the CHAT_UI_URL host. Re-onboarding a running OpenClaw sandbox with a new or removed origin says that a rebuild applies it.
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Code coverage overviewLanguages: TypeScript TypeScript / code-coverage/plugin
View coverage of the 10 most impacted files.
TypeScript / code-coverage/cli
View coverage of the 10 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Live onboard and rebuildRun against
Before this change, the same rebuild reset Local setup differences from a release install:
|
Address the PR Review Advisor findings on #13198: - Test that a failed inner onboard still receives the recorded dashboard origin and that the ambient CHAT_UI_URL is restored afterwards. - Document that changing or clearing CHAT_UI_URL for an existing sandbox takes effect only after a rebuild. Refs #13177
|
🌿 Preview your docs: https://nvidia-preview-pr-13198.docs.buildwithfern.com/nemoclaw |
PR Review Advisor findings on
|
The note about changing CHAT_UI_URL applied to every repeat onboarding. Only reuse keeps the running gateways
The note about changing CHAT_UI_URL applied to every repeat onboarding. Only reuse keeps the running gateways
|
PR Review Advisor finished for commit Request review only when Require no Advisor blockers is green. |
Ready for reviewCI on Live E2E: the live check for this PR is in #13218, which is stacked on this branch. The Podman activation job failed once on this commit at an OpenClaw admin-approval step; a single rerun passed. |
rsliter
left a comment
There was a problem hiding this comment.
Reviewed latest PR commit 77290aae91c0c04b5e83af13c689aa064a104ab3 against base SHA 7db58ebb9abfb187ba0c072f56189eff9dcc589f.
Outcome: Comment. I found no blocking correctness or security defect. The change keeps the registry as the dashboard-origin authority, preserves the legacy managed-profile fallback, distinguishes a cleared record from a missing record, prevents ambient CHAT_UI_URL from changing rebuild behavior, and restores the caller environment after success or failure. The changed tests cover recorded, legacy, cleared, ambient, custom-image, reuse, and failure-restoration paths. All required checks pass for this commit.
Security review: PASS for secrets and credentials, input validation, authentication and authorization, dependencies, error handling and logging, cryptography and data protection, configuration, security testing, and system security. This change does not widen the dashboard bind. Persisted URLs remain validated, Docker arguments remain sanitized, and warning text strips control characters.
Recommended E2E context:
- The current PR Review Advisor run recommends a live OpenClaw onboard, reuse, and rebuild with a non-loopback recorded origin.
dashboard-remote-bindis the closest inventory job, but the Advisor reports no supported selector for this boundary. - No live run tested latest PR commit
77290aae91c0c04b5e83af13c689aa064a104ab3. - The prior manual evidence passed on stacked commit
1e1ee70e6, which included an older commit from this PR. It does not verify the latest PR commit. - PR #13218 is a complementary stacked change based on this PR. Its added boundary coverage does not provide evidence for this PR commit.
I cannot approve until a live run tests 77290aae91c0c04b5e83af13c689aa064a104ab3. Run the documented manual scenario against this commit, or use a supported selector when one becomes available, then request another review.
|
Agreed. The earlier manual run tested stacked commit I checked all nine specialist artifacts from Advisor run 38886107080. They report no P0/P1 code findings. The two unresolved live-test recommendations match your request. The remaining evidence must come from onboard, reuse, and rebuild on That validation is still pending. The earlier “Ready for review” comment does not establish that this requirement is complete. |
|
The requested live onboard, reuse, and rebuild scenario now passes on reviewed commit Tested from a clean detached checkout on Ubuntu 24.04 ARM64, Docker 29.8.1, OpenShell 0.0.116, and OpenClaw 2026.9.2. Inference used CPU Ollama with
Rebuild printed: Before and after rebuild, a browser WebSocket probe with the recorded origin passed origin validation and reached the device-authentication requirement ( Cleanup removed the test sandbox, gateway, proxy listeners, and isolated test home. Independent checks confirmed no test containers or listeners remained and the pre-existing sandbox was still running. The PR commit and tracked source are unchanged. |
rsliter
left a comment
There was a problem hiding this comment.
Approve.
I reviewed latest PR commit 77290aae91c0c04b5e83af13c689aa064a104ab3 against base SHA 7db58ebb9abfb187ba0c072f56189eff9dcc589f.
The code and security conclusions from my earlier review remain current. Required checks pass, CodeRabbit has no actionable finding, and the PR Review Advisor found no P0 or P1 code issue.
The Advisor's two overlapping live recommendations are now covered by one exact-commit scenario: OpenClaw onboard, sandbox reuse, and rebuild with a non-loopback recorded origin. The run passed on 77290aae91c0c04b5e83af13c689aa064a104ab3. It confirmed the recorded origin before and after reuse and rebuild, rejected a conflicting origin, preserved readiness, and completed cleanup. Evidence: #13198 (comment). The run used the immutable ARM64 managed image from https://github.com/NVIDIA/NemoClaw/actions/runs/38883837461.
No blocking defect remains.
#13198 merged into main, so #13218 now targets main. Source conflicts keep this branch's version, which already contains #13198. Generated files take main's copies and are refreshed: - startup bundle rebuilt and its pin updated; - assertion budget regenerated from the census; - the #13218 exception entry now uses the change digest against main. The Pi receipts take main's copies and are refreshed from this commit's CI run.
Outcome
Rebuilding an OpenClaw sandbox now keeps the browser origin recorded at onboarding in
gateway.controlUi.allowedOrigins. Before this change, every rebuild reset the allowed origins to loopback, so the dashboard behind a remote or reverse-proxy URL rejected the browser after a rebuild.Reason
Onboarding records the external dashboard URL in the registry as
dashboardExternalUrl. Rebuild ignored that record. The managed replacement profile and the custom-image path both wrotehttp://127.0.0.1:<port>for OpenClaw. A user could not restore the origin:config setrefusesgateway.*, and an exportedCHAT_UI_URLhad no reliable effect on rebuild.Related issues
Refs #13177. This PR delivers the issue's first expected result. A follow-up PR adds a separate browser-origin setting for origins with their own port. Documentation for browser-only hosts follows after both merge.
Changes
dashboardExternalUrlexisted, it uses the external URL from the previous managed startup profile. A cleared record (null) rebuilds on loopback.resolveRecordedDashboardUrlForPortinsrc/lib/dashboard/url.tsmakes this choice. The managed profile, custom-image preflight, and recreate paths all use it.CHAT_UI_URLfrom its own environment and prints a warning when that value differs from the replayed origin. The warning names the command that changes the origin: re-onboard with the newCHAT_UI_URL, then rebuild. An exported variable left over from another task therefore cannot silently change what the dashboard accepts. The recreate step restores the caller'sCHAT_UI_URLwhen it finishes.--control-ui-portnow selects only the dashboard port. Before, it also discarded the host fromCHAT_UI_URL.Verification
npx vitest runfor therebuild-managed-workload-mutation-guard,rebuild-recreate-reasoning,rebuild-env-isolation,rebuild-target-runtime,rebuild-flow,rebuild-flow-helpers,dashboard-port, andsandbox-reusetests on dfc75f4 — 7 files, 181 tests passed. The new tests failed before the fix.scripts/checks/source-architecture.mtsandscripts/checks/layer-import-boundaries.mts— passed.CHAT_UI_URL=https://dash.example.testrecordeddashboardExternalUrlashttps://dash.example.test:18789, and the sandboxallowedOriginsincluded it — passed.main, rebuild stops in the pre-delete backup because the archive credential check rejects the generated${NVIDIA_INFERENCE_API_KEY}reference inopenclaw.json. That failure occurs before any code in this PR runs, and fix(onboard): preserve sandbox route after failed recreate backup #13051 fixes it. The live rebuild evidence will be added after fix(onboard): preserve sandbox route after failed recreate backup #13051 merges.Review notes
This PR changes contributor sensitive paths under
src/lib/onboard/**:dashboard-port.ts,dashboard-runtime.ts,sandbox-reuse.ts, andsandbox-create/orchestration.ts. No pre-publication review exists; these paths await independent review.Rebuild deliberately ignores an exported
CHAT_UI_URLand warns instead. This PR chooses a warning over letting the export replace the recorded origin, so a stale shell export cannot silently widen or narrowallowedOrigins. One known effect: re-onboarding a sandbox withoutCHAT_UI_URLclears the recorded origin, and the next rebuild then uses loopback. Onboard prints a note when this happens.The issue's second request, adding an origin whose port differs from the dashboard port, is out of scope here. A follow-up PR implements it as a separate onboard setting.
Signed-off-by: Kao Félix me@kaofelix.dev
Summary by CodeRabbit
CHAT_UI_URLvalue. If no origin is recorded, they use a local address.CHAT_UI_URLdoes not change the origins accepted by a running dashboard until the sandbox is rebuilt.