From f98811a67c1e4e4b0d19139da410c317f5ba88e5 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 23 Mar 2026 04:50:21 -0700 Subject: [PATCH] fix: harden parallels smoke agent invocation --- .../skills/openclaw-parallels-smoke/SKILL.md | 2 ++ scripts/e2e/parallels-macos-smoke.sh | 27 ++++++++++++++----- scripts/e2e/parallels-npm-update-smoke.sh | 6 ++--- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/.agents/skills/openclaw-parallels-smoke/SKILL.md b/.agents/skills/openclaw-parallels-smoke/SKILL.md index d8182e399b4..c182f607533 100644 --- a/.agents/skills/openclaw-parallels-smoke/SKILL.md +++ b/.agents/skills/openclaw-parallels-smoke/SKILL.md @@ -23,6 +23,7 @@ Use this skill for Parallels guest workflows and smoke interpretation. Do not lo - Preferred entrypoint: `pnpm test:parallels:npm-update` - Flow: fresh snapshot -> install npm package baseline -> smoke -> install current main tgz on the same guest -> smoke again. - Same-guest update verification should set the default model explicitly to `openai/gpt-5.4` before the agent turn and use a fresh explicit `--session-id` so old session model state does not leak into the check. +- Keep the aggregate npm-update Linux VM name aligned with the default Linux smoke VM (`Ubuntu 24.04.3 ARM64` on Peter's host today). Do not hardcode a different Linux guest in the wrapper unless the per-OS Linux smoke default changed too. - On Windows same-guest update checks, restart the gateway after the npm upgrade before `gateway status` / `agent`; in-place global npm updates can otherwise leave stale hashed `dist/*` module imports alive in the running service. - Linux same-guest update verification should also export `HOME=/root`, pass `OPENAI_API_KEY` via `prlctl exec ... /usr/bin/env`, and use `openclaw agent --local`; the fresh Linux baseline does not rely on persisted gateway credentials. @@ -32,6 +33,7 @@ Use this skill for Parallels guest workflows and smoke interpretation. Do not lo - Default to the snapshot closest to `macOS 26.3.1 latest`. - On Peter's Tahoe VM, `fresh-latest-march-2026` can hang in `prlctl snapshot-switch`; if restore times out there, rerun with `--snapshot-hint 'macOS 26.3.1 latest'` before blaming auth or the harness. - `prlctl exec` is fine for deterministic repo commands, but use the guest Terminal or `prlctl enter` when installer parity or shell-sensitive behavior matters. +- Multi-word `openclaw agent --message ...` checks should go through a guest shell wrapper (`guest_current_user_sh` / `guest_current_user_cli` or `/bin/sh -lc ...`), not raw `prlctl exec ... node openclaw.mjs ...`, or the message can be split into extra argv tokens and Commander reports `too many arguments for 'agent'`. - On the fresh Tahoe snapshot, `brew` exists but `node` may be missing from PATH in noninteractive exec. Use `/opt/homebrew/bin/node` when needed. - Fresh host-served tgz installs should install as guest root with `HOME=/var/root`, then run onboarding as the desktop user via `prlctl exec --current-user`. - Root-installed tgz smoke can log plugin blocks for world-writable `extensions/*`; do not treat that as an onboarding or gateway failure unless plugin loading is the task. diff --git a/scripts/e2e/parallels-macos-smoke.sh b/scripts/e2e/parallels-macos-smoke.sh index 247aa80574d..c78350faef1 100644 --- a/scripts/e2e/parallels-macos-smoke.sh +++ b/scripts/e2e/parallels-macos-smoke.sh @@ -438,6 +438,15 @@ guest_current_user_exec() { "$@" } +guest_current_user_cli() { + local parts=() arg joined="" + for arg in "$@"; do + parts+=("$(shell_quote "$arg")") + done + joined="${parts[*]}" + guest_current_user_sh "$joined" +} + guest_script() { local mode script mode="$1" @@ -675,9 +684,9 @@ EOF } run_ref_onboard() { - guest_current_user_exec \ + guest_current_user_cli \ /usr/bin/env "OPENAI_API_KEY=$OPENAI_API_KEY_VALUE" \ - "$GUEST_NODE_BIN" "$GUEST_OPENCLAW_ENTRY" onboard \ + "$GUEST_OPENCLAW_BIN" onboard \ --non-interactive \ --mode local \ --auth-choice openai-api-key \ @@ -691,19 +700,23 @@ run_ref_onboard() { } verify_gateway() { - guest_current_user_exec "$GUEST_NODE_BIN" "$GUEST_OPENCLAW_ENTRY" gateway status --deep --require-rpc + guest_current_user_cli "$GUEST_OPENCLAW_BIN" gateway status --deep --require-rpc } show_gateway_status_compat() { - if guest_current_user_exec "$GUEST_NODE_BIN" "$GUEST_OPENCLAW_ENTRY" gateway status --help | grep -Fq -- "--require-rpc"; then - guest_current_user_exec "$GUEST_NODE_BIN" "$GUEST_OPENCLAW_ENTRY" gateway status --deep --require-rpc + if guest_current_user_cli "$GUEST_OPENCLAW_BIN" gateway status --help | grep -Fq -- "--require-rpc"; then + guest_current_user_cli "$GUEST_OPENCLAW_BIN" gateway status --deep --require-rpc return fi - guest_current_user_exec "$GUEST_NODE_BIN" "$GUEST_OPENCLAW_ENTRY" gateway status --deep + guest_current_user_cli "$GUEST_OPENCLAW_BIN" gateway status --deep } verify_turn() { - guest_current_user_exec "$GUEST_NODE_BIN" "$GUEST_OPENCLAW_ENTRY" agent --agent main --message ping --json + guest_current_user_cli \ + "$GUEST_OPENCLAW_BIN" agent \ + --agent main \ + --message "Reply with exact ASCII text OK only." \ + --json } configure_discord_smoke() { diff --git a/scripts/e2e/parallels-npm-update-smoke.sh b/scripts/e2e/parallels-npm-update-smoke.sh index 8e5ed9d4b5c..6ecf95df942 100755 --- a/scripts/e2e/parallels-npm-update-smoke.sh +++ b/scripts/e2e/parallels-npm-update-smoke.sh @@ -5,7 +5,7 @@ ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" MACOS_VM="macOS Tahoe" WINDOWS_VM="Windows 11" -LINUX_VM="Ubuntu 25.10" +LINUX_VM="Ubuntu 24.04.3 ARM64" OPENAI_API_KEY_ENV="OPENAI_API_KEY" PACKAGE_SPEC="" JSON_OUTPUT=0 @@ -203,8 +203,8 @@ case "\$version" in ;; esac /opt/homebrew/bin/openclaw models set openai/gpt-5.4 -/opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/openclaw.mjs gateway status --deep --require-rpc -/opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/openclaw.mjs agent --agent main --session-id parallels-npm-update-macos-$head_short --message "Reply with exact ASCII text OK only." --json +/opt/homebrew/bin/openclaw gateway status --deep --require-rpc +/opt/homebrew/bin/openclaw agent --agent main --session-id parallels-npm-update-macos-$head_short --message "Reply with exact ASCII text OK only." --json EOF prlctl exec "$MACOS_VM" --current-user /bin/bash /tmp/openclaw-main-update.sh }