Repository navigation
fix: gate dashboard on gateway readiness - #82547
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6f8faddf40
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| await runDaemonStart({ json: false }); | ||
| }); | ||
|
|
||
| const initialStatus = await gatherStatus(); |
There was a problem hiding this comment.
Handle status probe errors before gating dashboard
Wrap the readiness probe call in error handling; right now const initialStatus = await gatherStatus() can throw and abort openclaw dashboard instead of producing recovery guidance. This regresses environments where gatherDaemonStatus is unavailable/fails (for example, resolveGatewayService() throws on unsupported platforms in src/daemon/service.ts) because dashboard previously just printed/opened the URL, but now exits through runCommandWithRuntime with an error. Treat probe failures as a non-ready result (with hints) so dashboard does not hard-fail on status-gather exceptions.
Useful? React with 👍 / 👎.
Summary
openclaw dashboardon that helper, including--yessupport and dashboard-safe readiness for authenticated gateway close/pairing statesVerification
node scripts/run-vitest.mjs src/commands/gateway-readiness.test.ts src/commands/dashboard.test.ts src/commands/dashboard.links.test.ts src/cli/program/register.maintenance.test.ts src/cli/qr-dashboard.integration.test.tspnpm buildtmpdir=$(mktemp -d); OPENCLAW_STATE_DIR="$tmpdir" OPENCLAW_GATEWAY_PORT=49876 node openclaw.mjs dashboard --no-open 2>&1 | sed -n '1,120p'; rm -rf "$tmpdir"git diff --check HEAD^..HEADcodex-review --full-accessReal behavior proof
Behavior addressed:
openclaw dashboardno longer prints/copies/opens a dashboard URL before checking that the configured gateway target is usable or recoverable.Real environment tested: local macOS checkout on Node/OpenClaw build output, with isolated
OPENCLAW_STATE_DIRand unused gateway port.Exact steps or command run after this patch: ran the focused Vitest command above,
pnpm build, isolatedopenclaw.mjs dashboard --no-opensmoke,git diff --check HEAD^..HEAD, andcodex-review --full-access.Evidence after fix: terminal output from the isolated live CLI smoke was copied after this patch:
Gateway is not running.followed byRun openclaw gateway status --deep for details.,Run openclaw gateway start to start a managed gateway., andRun openclaw gateway run for a foreground gateway.NoDashboard URL:line was printed.Observed result after fix: dashboard readiness refused the dead configured target in actual CLI output, printed recovery commands, and did not copy/open a dashboard URL; helper tests additionally cover known gateway auth/pairing close states and unrelated busy ports.
What was not tested: live launchd/systemd/scheduled-task start from an interactive prompt was covered by injected helper tests, not by mutating the developer machine service manager.