OpenClaw staging test
Publish a reviewer-testable Control UI without exposing an authenticated OpenClaw Gateway, browser proxy, or operator credentials.
Workflow
Ensure the helper is available on
PATH:install -m 755 \ skills/openclaw/openclaw-stg-test/scripts/openclaw-stg-test \ ~/.local/bin/openclaw-stg-testPrepare a loopback-only preview from the intended checkout.
Reuse the checkout's Control UI and repository-owned E2E mock Gateway. Keep scenario files under
.artifacts/openclaw-stg-test/so proof setup files are not committed. Serve the required safety attestation from the same origin. Read references/preview-contract.md for the contract and Vite middleware example.Verify the scenario locally before publishing it.
Exercise the changed behavior through the local preview. Confirm the browser uses only the mock Gateway and that no request targets a real Gateway, browser proxy, credential, or private endpoint.
Start the leased Quick Tunnel:
openclaw-stg-test --url http://127.0.0.1:<preview-port> --ttl 4hThe helper refuses non-loopback origins, known OpenClaw Gateway and
openclaw-local-testports, missing or unsafe attestations, and leases over 24 hours. It waits for the public attestation before returning the URL.Verify the public URL as a fresh browser user.
Repeat the changed interaction through the
trycloudflare.comURL. Treat this as behavioral proof, not merely a reachability check. When running inside OpenClaw, use its browser tool oropenclaw browser. Discover the current browser state and available profiles with:openclaw browser --json status openclaw browser profilesChoose a unique, run-owned profile name of 1–64 characters. It must begin with a lowercase letter or digit and contain only lowercase letters, digits, and hyphens. Never reuse an existing disposable or authenticated profile. On the host that owns the browser, create the profile, run the public walkthrough through it, then delete only that run-owned profile:
openclaw browser create-profile --name <unique-fresh-profile> openclaw browser --browser-profile <unique-fresh-profile> open <public-url> # Run the complete public walkthrough before cleanup. openclaw browser delete-profile --name <unique-fresh-profile>As soon as the profile is created, treat profile deletion and any temporary allowlist entry as cleanup obligations on every exit path. On success, walkthrough failure, interruption, a blocked state, or a needs-user stop, remove the run-owned allowlist entry and delete the run-owned profile before the terminal handoff. If cleanup fails, do not delete unrelated profiles or allowlist entries; include the exact leftover profile or entry in the terminal handoff.
A remote node browser proxy rejects persistent profile creation and deletion. For a proxied browser, run those lifecycle commands on the browser node and temporarily expose the new profile through
nodeHost.browserProxy.allowProfileswhen that allowlist is configured. Remove that run-owned entry as part of the required cleanup. Keep the browser proxy loopback-only and outside the tunnel.When publishing proof to GitHub, use the persistent managed
githubbrowser profile owned by theopenclawservice user:env HOME=/var/lib/openclaw \ /var/lib/openclaw/.local/bin/openclaw browser \ --browser-profile github status --jsonThe login persists in
/var/lib/openclaw/.openclaw/browser/github/user-data; stopping or starting the named profile must preserve it. Confirm authentication from a rendered GitHub page and its final URL. If a browser command fails, check profile readiness, controller ownership, and OpenClaw state-database health before concluding that GitHub signed out. Start the existing named profile when it is stopped; do not replace it with a temporary profile or reset its auth.Report the public URL, tested route, scenario, lease expiry, local checkout, and commands for lifecycle control:
openclaw-stg-test --status openclaw-stg-test --stopReturn the result in the originating session. If the workflow stops early, becomes blocked, or needs a user decision, report that state with one concrete next action or question.
Done means
- The preview runs from the intended checkout and demonstrates the changed behavior with a browser-side mock or static fixture.
- The origin's attestation passes and the public URL serves the same attestation.
- A fresh remote browser can complete the intended interaction.
- GitHub proof publication, when requested, uses the persistent managed
githubprofile and is verified from a rendered signed-in page. - The handoff names the scenario, route, expiry, and stop command.
- No live Gateway, browser proxy, credentials, private data, or private endpoint values crossed the tunnel.
Guardrails
- Use
openclaw-local-testfor authenticated local testing; keep it loopback only. - Use a bounded lease. Start a new lease when more review time is needed.
- Put synthetic, non-sensitive data in the mock scenario.
- Stop the tunnel immediately when the proof is complete or its safety posture becomes uncertain.
- Keep the managed
githubprofile, its CDP endpoint, cookies, and user-data directory outside the tunnel. Use it only as the authenticated publication client. - Never point this helper, another tunnel, or a reverse proxy at port
18789, anopenclaw-local-testGateway/browser proxy, or any authenticated Gateway.