Files
Peter Steinberger b85a049da5 chore: migrate tooling and source installs to pnpm 12 (#131043)
* build: migrate tooling and source installs to pnpm 12

Pin the verified native toolchain without changing application dependency
versions. Preserve the existing release-age policy explicitly and separate
package-manager lock metadata from the application dependency graph.

Use exact checkout pins for bootstrap and rollback, approve only the native
pnpm installer where npm requires it, and retain global install ownership
without equating the CLI major to the storage layout. Verify the Docker
runtime toolchain offline as its non-root user.

Remove duplicate bootstrap paths and obsolete prune input, update native
CLI flags and regression fixtures, and preserve UTF-8 in macOS Bash
installer NDJSON output.

* fix(build): isolate production dependency installs for pnpm 12

Build production dependencies from the same frozen manifest inputs instead
of pruning the inherited development tree. pnpm 12's native hoisted
importer cannot rename lower-layer OverlayFS directories during pruning.
Preserve native addon outputs, workspace builds, and offline non-root
Corepack use while deleting the obsolete production-store seeder.

Exercise runtime assembly and explicitly consent to the local agent-plugin
E2E fixture under the current plugin capability contract.

Validated full Matrix image and offline non-root runtime, focused Docker
regressions, full checks with test types and architecture, docs, real
agent-plugin gateway E2E, and isolated Codex autoreview.

* test: align package smoke with pnpm 12 global installs

* test: follow native pnpm artifact approval in distribution guard

* test: modernize pnpm fixtures for v12

* test: align rebased update fixtures with pnpm 12

* test: retain sanitized upgrade restart diagnostics

* test: expose CI navigation failures and register diagnostics

* test: retain post-core outcomes and plugin artifact identity

* chore(tooling): group upgrade diagnostic entrypoints

* fix(update): support native pnpm global installs and source links

Qualify local source and archive specs, carry verified global ownership through pnpm configuration, and verify intentional checkout links with shared runtime-readiness checks. Preserve strict packaged-install verification and manager ownership safeguards.

Verified the production updater with pnpm 11.22 and 12 using default and custom roots, source links, and tarball updates.

* test: preserve survivor diagnostics after service sealing

Promote incomplete exit-zero runs before failure capture and exercise the sealed-service manager fixture without inventing successful child exits.

* fix(update): preserve legacy pnpm global ownership

Carry the verified root and bin through both pnpm and npm configuration dialects after original-environment probes. Real pnpm 10 custom-root updates and pnpm 11/12 source and tarball matrices pass without redirecting the caller or weakening ownership checks.

* test(update): verify wizard consent through checkout handoff

Use the prepared checkout and fresh-process finalization boundary introduced by the updater repair. Preserve explicit consent forwarding before and after the wizard subcommand without assuming plugin callbacks run in the old process.

* refactor(update): validate checkout build metadata records

Use the canonical record coercer instead of carrying an unchecked assertion into the shared runtime verifier. Remove the now-unused grandfathered assertion entry; no allowance is added.

* docs(sandbox): document standalone common-image inputs

* test(packaging): account for required native prebuilds

Align installer and release size budgets at 235 MiB for the required native payload added on main. Keep both loader layouts, upstream binaries, explicit overrides, and missing-data rejection intact. Exercise actual defaults and the one-byte boundary. Retain bounded stderr diagnostics for the intermittent Bun signal test without claiming a production signal fix.

* test: align refreshed installer fixtures with pnpm 12

* fix(test): share Bun smoke force-kill ownership

Record the successful force-kill once across the timer and post-close drain. Native Darwin traces reproduced both duplicate-signal orders; genuine permission failures and uncleared groups still fail without extending deadlines.
2026-08-28 17:43:09 -07:00

13 KiB

summary, read_when, title
summary read_when title
macOS app flow for controlling a remote OpenClaw gateway
Setting up or debugging remote mac control
Remote control

This flow lets the macOS app act as a full remote control for an OpenClaw gateway running on another host (desktop/server). The app connects directly to trusted LAN/Tailnet gateway URLs, or manages an SSH tunnel when the remote gateway is loopback-only. Health checks, Voice Wake forwarding, and Web Chat reuse the same remote configuration from Settings -> General.

Modes

  • Local (this Mac): everything runs on the laptop; no SSH involved.
  • Remote over SSH (default): OpenClaw commands run on the remote host. The app opens an SSH connection with -o BatchMode, your chosen identity/key, and a local port-forward.
  • Remote direct (ws/wss): no SSH tunnel; the app connects to the gateway URL directly (LAN, Tailscale, Tailscale Serve, or a public HTTPS reverse proxy).

Remote transports

  • SSH tunnel (default): uses ssh -N -L ... to forward the gateway port to localhost. The gateway sees the node's IP as 127.0.0.1 because the tunnel is loopback.
  • Direct (ws/wss): connects straight to the gateway URL. The gateway sees the real client IP.

The app disables SSH connection multiplexing and post-authentication backgrounding for its own SSH processes so it can monitor and restart the exact process, even if the selected alias enables ControlMaster or ForkAfterAuthentication.

SSH host-key verification is strict by default because gateway credentials travel through this tunnel. To opt into a managed SSH alias's own trust behavior, set --ssh-host-key-policy openssh via openclaw-mac configure-remote, or set gateway.remote.sshHostKeyPolicy to "openssh" directly. Review the alias and any matching Host * or system configuration before opting in. Changing the SSH target (in the app or via configure-remote) resets the policy back to strict unless you explicitly opt in again for the new target.

In SSH tunnel mode, discovered LAN/tailnet hostnames save as gateway.remote.sshTarget. The app keeps gateway.remote.url on the local tunnel endpoint (for example ws://127.0.0.1:18789) so CLI, Web Chat, and the local node-host service all use the same loopback transport. When discovery returns both raw Tailnet IPs and stable hostnames, the app prefers Tailscale MagicDNS or LAN names so connections survive address changes better. If the local tunnel port differs from the remote gateway port, set gateway.remote.remotePort to the port on the remote host.

Browser automation in remote mode is owned by the CLI node host, not the native macOS app node. The app starts the installed node host service when possible; to enable browser control from that Mac, install/start it with openclaw node install ... and openclaw node start (or run openclaw node run ... in the foreground), then target that browser-capable node.

Prereqs on the remote host

  1. Install Node + pnpm, then build/install the OpenClaw CLI from its checkout (pnpm install && pnpm build && pnpm add --global "openclaw@link:$PWD").
  2. Ensure openclaw is on PATH for non-interactive shells (symlink into /usr/local/bin or /opt/homebrew/bin if needed).
  3. For SSH transport: set up key-based SSH auth. Tailscale IPs are recommended for stable reachability off-LAN.

macOS app setup

To preconfigure the app without the welcome flow, over SSH:

openclaw-mac configure-remote \
  --ssh-target user@gateway-host \
  --local-port 18789 \
  --remote-port 18789 \
  --token "$OPENCLAW_GATEWAY_TOKEN"

Or for a gateway already reachable on a trusted LAN or Tailnet, skip SSH entirely:

openclaw-mac configure-remote \
  --direct-url ws://192.168.0.202:18789 \
  --token "$OPENCLAW_GATEWAY_TOKEN"

openclaw-mac connect, wizard, and configure-remote resolve the active config in this order: OPENCLAW_CONFIG_PATH, then $OPENCLAW_STATE_DIR/openclaw.json, then ~/.openclaw/openclaw.json. Both configuration forms write that active file, mark onboarding complete, and let the app own the selected transport on next start. --local-port/--remote-port default to 18789. Other flags: --password, --identity <path>, --ssh-host-key-policy <strict|openssh>, --project-root <path>, --cli-path <path>, --json. Run openclaw-mac configure-remote --help for the full reference.

To configure from the UI instead:

  1. Open Settings -> General.
  2. Under OpenClaw runs, pick Remote and set:
    • Transport: SSH tunnel or Direct (ws/wss).
    • SSH target: user@host (optional :port). If the gateway is on the same LAN and advertises Bonjour, pick it from the discovered list to auto-fill this field.
    • Gateway URL (Direct only): wss://gateway.example.ts.net (or ws://... for local/LAN).
    • Identity file (advanced): path to your key.
    • Project root (advanced): remote checkout path used for commands.
    • CLI path (advanced): optional path to a runnable openclaw entrypoint/binary (auto-filled when advertised).
  3. Hit Test remote. Success means the remote openclaw status --json ran correctly. Failures usually mean PATH/CLI issues; exit 127 means the CLI was not found remotely.
  4. Health checks and Web Chat now run through the selected transport automatically.

Web Chat

  • SSH tunnel: connects to the gateway over the forwarded WebSocket control port (default 18789).
  • Direct (ws/wss): connects straight to the configured gateway URL.
  • There is no separate Web Chat HTTP server.

Permissions

  • The remote host needs the same TCC approvals as local (Automation, Accessibility, Screen Recording, Microphone, Speech Recognition, Notifications). Run onboarding on that machine once to grant them.
  • Nodes advertise their permission state via node.list / node.describe so agents know what is available.

Security notes

  • Prefer loopback binds on the remote host and connect via SSH, Tailscale Serve, or a trusted Tailnet/LAN direct URL.
  • SSH tunneling requires an already-trusted host key by default. Trust the host key first (add it to the configured known-hosts file), or explicitly set gateway.remote.sshHostKeyPolicy: "openssh" for a managed alias whose OpenSSH trust policy you accept.
  • If you bind the Gateway to a non-loopback interface, require valid Gateway auth: token, password, or an identity-aware reverse proxy with gateway.auth.mode: "trusted-proxy".
  • Direct wss:// connections apply one certificate policy to both operator/control traffic and the Mac companion node. Set gateway.remote.tlsFingerprint for an explicit pin. Without one, the app records a first-use pin only after normal macOS trust succeeds.
  • See Security and Tailscale.

WhatsApp login flow (remote)

  • Run openclaw channels login --channel whatsapp --verbose on the remote host. Scan the QR with WhatsApp on your phone.
  • Re-run login on that host if auth expires. The health check surfaces link problems.

Troubleshooting

Symptom Cause / fix
exit 127 / not found openclaw is not on PATH for non-login shells. Add it to /etc/paths, your shell rc, or symlink into /usr/local/bin//opt/homebrew/bin.
Health probe failed Check SSH reachability, PATH, and that Baileys (WhatsApp) is logged in (openclaw status --json).
Web Chat stuck Confirm the gateway is running on the remote host and the forwarded port matches the gateway WS port; the UI requires a healthy WS connection.
Node IP shows 127.0.0.1 Expected with the SSH tunnel. Switch Transport to Direct (ws/wss) if you want the gateway to see the real client IP.
Dashboard works but Mac capabilities are offline The operator/control connection is healthy, but the companion node connection is not connected or is missing its command surface. Open the menu bar device section and check whether the Mac is paired · disconnected. Direct wss:// operator and node connections use the same configured or stored certificate policy. For trusted wss://*.ts.net Tailscale Serve endpoints, stale stored leaf pins are replaced after certificate rotation and retried automatically. Configured pins never rotate automatically; update gateway.remote.tlsFingerprint after reviewing the new certificate, or switch to Remote over SSH.
Voice Wake Trigger phrases forward automatically in remote mode; no separate forwarder is needed.

Notification sounds

Pick sounds per notification from scripts with openclaw nodes notify, for example:

openclaw nodes notify --node <id> --title "Ping" --body "Remote gateway ready" --sound Glass

There is no global default-sound toggle in the app; callers choose a sound (or none) per request.