From 154512f2e14400a5372036a7b8e02466734bb7fb Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 2 May 2026 20:14:45 +0100 Subject: [PATCH] test: support published beta codex plugin smoke --- scripts/e2e/codex-npm-plugin-live-docker.sh | 8 +++++++- scripts/e2e/lib/codex-npm-plugin-live/assertions.mjs | 11 +++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/scripts/e2e/codex-npm-plugin-live-docker.sh b/scripts/e2e/codex-npm-plugin-live-docker.sh index 6dae81500c7..30c63b11847 100644 --- a/scripts/e2e/codex-npm-plugin-live-docker.sh +++ b/scripts/e2e/codex-npm-plugin-live-docker.sh @@ -44,6 +44,8 @@ echo "Running Codex npm plugin live Docker E2E..." echo "Profile file: $PROFILE_STATUS" if ! docker_e2e_run_with_harness \ -e COREPACK_ENABLE_DOWNLOAD_PROMPT=0 \ + -e OPENCLAW_CODEX_NPM_PLUGIN_ALLOW_BETA_COMPAT_DIAGNOSTICS="${OPENCLAW_CODEX_NPM_PLUGIN_ALLOW_BETA_COMPAT_DIAGNOSTICS:-0}" \ + -e OPENCLAW_CODEX_NPM_PLUGIN_FORCE_UNSAFE_INSTALL="${OPENCLAW_CODEX_NPM_PLUGIN_FORCE_UNSAFE_INSTALL:-0}" \ -e OPENCLAW_CODEX_NPM_PLUGIN_MODEL="${OPENCLAW_CODEX_NPM_PLUGIN_MODEL:-codex/gpt-5.4}" \ -e OPENCLAW_CODEX_NPM_PLUGIN_SPEC="${OPENCLAW_CODEX_NPM_PLUGIN_SPEC:-npm:@openclaw/codex@beta}" \ -e "OPENCLAW_TEST_STATE_SCRIPT_B64=$OPENCLAW_TEST_STATE_SCRIPT_B64" \ @@ -83,6 +85,10 @@ CODEX_PLUGIN_SPEC="${OPENCLAW_CODEX_NPM_PLUGIN_SPEC:?missing OPENCLAW_CODEX_NPM_ MODEL_REF="${OPENCLAW_CODEX_NPM_PLUGIN_MODEL:?missing OPENCLAW_CODEX_NPM_PLUGIN_MODEL}" SESSION_ID="codex-npm-plugin-live" SUCCESS_MARKER="OPENCLAW-CODEX-NPM-PLUGIN-LIVE-OK" +PLUGIN_INSTALL_FLAGS=(--force) +if [ "${OPENCLAW_CODEX_NPM_PLUGIN_FORCE_UNSAFE_INSTALL:-0}" = "1" ]; then + PLUGIN_INSTALL_FLAGS+=(--dangerously-force-unsafe-install) +fi dump_debug_logs() { local status="$1" @@ -110,7 +116,7 @@ openclaw_e2e_install_package /tmp/openclaw-install.log command -v openclaw >/dev/null echo "Installing Codex plugin from npm: $CODEX_PLUGIN_SPEC" -openclaw plugins install "$CODEX_PLUGIN_SPEC" --force >/tmp/openclaw-codex-plugin-install.log 2>&1 +openclaw plugins install "$CODEX_PLUGIN_SPEC" "${PLUGIN_INSTALL_FLAGS[@]}" >/tmp/openclaw-codex-plugin-install.log 2>&1 node scripts/e2e/lib/codex-npm-plugin-live/assertions.mjs configure "$MODEL_REF" diff --git a/scripts/e2e/lib/codex-npm-plugin-live/assertions.mjs b/scripts/e2e/lib/codex-npm-plugin-live/assertions.mjs index a92587df410..5b51ebb04a8 100644 --- a/scripts/e2e/lib/codex-npm-plugin-live/assertions.mjs +++ b/scripts/e2e/lib/codex-npm-plugin-live/assertions.mjs @@ -3,6 +3,8 @@ import path from "node:path"; const command = process.argv[2]; const readJson = (file) => JSON.parse(fs.readFileSync(file, "utf8")); +const allowBetaCompatDiagnostics = + process.env.OPENCLAW_CODEX_NPM_PLUGIN_ALLOW_BETA_COMPAT_DIAGNOSTICS === "1"; function stateDir() { return process.env.OPENCLAW_STATE_DIR || path.join(process.env.HOME, ".openclaw"); @@ -127,8 +129,13 @@ function assertPlugin() { const errors = diagnostics .filter((diag) => diag?.level === "error") .map((diag) => String(diag.message || "")); - if (errors.length > 0) { - throw new Error(`unexpected plugin diagnostics errors: ${errors.join("; ")}`); + const unexpectedErrors = allowBetaCompatDiagnostics + ? errors.filter( + (message) => message !== "only bundled plugins can claim reserved command ownership: codex", + ) + : errors; + if (unexpectedErrors.length > 0) { + throw new Error(`unexpected plugin diagnostics errors: ${unexpectedErrors.join("; ")}`); } const record = readInstallRecord();