Skip to content

fix: gate dashboard on gateway readiness - #82547

Merged
steipete merged 1 commit into
mainfrom
fix/dashboard-gateway-readiness
May 16, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/dashboard-gateway-readiness

Conversation

@steipete

@steipete steipete commented May 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add a reusable gateway readiness helper that probes the intended target, prompts to install/start recoverable managed gateways, and prints recovery commands when not ready
  • gate openclaw dashboard on that helper, including --yes support and dashboard-safe readiness for authenticated gateway close/pairing states
  • add regression coverage for stopped gateways, target-port mismatches, auth-only dashboard readiness, unrelated busy ports, dashboard no-open behavior, and QR/dashboard SecretRef tests

Verification

  • 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.ts
  • pnpm build
  • tmpdir=$(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^..HEAD
  • codex-review --full-access

Real behavior proof

Behavior addressed: openclaw dashboard no 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_DIR and unused gateway port.
Exact steps or command run after this patch: ran the focused Vitest command above, pnpm build, isolated openclaw.mjs dashboard --no-open smoke, git diff --check HEAD^..HEAD, and codex-review --full-access.
Evidence after fix: terminal output from the isolated live CLI smoke was copied after this patch: Gateway is not running. followed by Run openclaw gateway status --deep for details., Run openclaw gateway start to start a managed gateway., and Run openclaw gateway run for a foreground gateway. No Dashboard 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.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes commands Command implementations size: L maintainer Maintainer-authored PR labels May 16, 2026
@steipete
steipete merged commit b5ba210 into main May 16, 2026
115 of 122 checks passed
@steipete
steipete deleted the fix/dashboard-gateway-readiness branch May 16, 2026 11:11

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations maintainer Maintainer-authored PR size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant