Skip to content

Commit ec3a834

Browse files
vincentkocsteipete
andauthored
fix(ci): keep plugin fixture validation compatible with capability consent (#131208)
* fix(ci): accept plugin fixture capabilities * fix(ci): detect fixture capability consent support Probe candidate command help through the existing bounded E2E runners so positive fixtures accept capabilities only when that command supports it. Preserve historical packages, probe failures, argv, and child exit status; keep negative, no-op, and integrity-bound update coverage unapproved. Replace duplicated probes and source-string checks with executable compatibility regressions. Synchronize the RPC timeout test with real process readiness before advancing its unchanged 100 ms deadline, while retaining real process-group termination and cleanup. Co-authored-by: Vincent Koc <[email protected]> * fix(ci): run Docker lanes from trusted harness Resolve package scripts and packaging tools from the trusted harness while keeping candidate source, artifacts, registry identity, and preflight on the frozen target. Remove candidate-script lane filtering and the duplicate live command wrapper; preserve source inputs in source-built Docker lanes. Prove the public scheduler boundary with distinct harness/target roots and poisoned candidate scripts. Synchronize scheduler timeout fixtures with real child readiness, retain real signals and kill grace, and handle empty QR build arguments on Bash 3. Co-authored-by: Vincent Koc <[email protected]> * test(ci): retire superseded harness source assertions Keep the workflow trust and pnpm PATH guards, but remove checks for the old inline replacement and deleted duplicate live-script wrapper. The public scheduler regressions now prove those behaviors through distinct candidate/harness roots and quoted pinned pnpm commands. Co-authored-by: Vincent Koc <[email protected]> * test(ci): cover multi-build source roots * fix(ci): select the harness toolchain before Docker lanes Start prepared pnpm commands in the trusted harness before Corepack resolves its package-manager pin. Preserve frozen candidate source and artifact identity, and resolve relative executable and cache paths before changing cwd. Keep quoted rerun environment values out of executable substitution. Cover different toolchain pins, shell-sensitive paths, and generated reruns through the public scheduler boundary. Co-authored-by: Vincent Koc <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]>
1 parent b5885ac commit ec3a834

33 files changed

Lines changed: 1315 additions & 411 deletions

‎scripts/e2e/agents-delete-shared-workspace-docker.sh‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
set -euo pipefail
33

44
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
5+
SOURCE_ROOT="${OPENCLAW_DOCKER_E2E_REPO_ROOT:-$ROOT_DIR}"
56
source "$ROOT_DIR/scripts/lib/docker-e2e-image.sh"
67

78
IMAGE_NAME="$(docker_e2e_resolve_image "openclaw-agents-delete-shared-workspace-e2e:local" OPENCLAW_AGENTS_DELETE_SHARED_WORKSPACE_E2E_IMAGE)"
89
SKIP_BUILD="${OPENCLAW_AGENTS_DELETE_SHARED_WORKSPACE_E2E_SKIP_BUILD:-0}"
910
DOCKER_COMMAND_TIMEOUT="${OPENCLAW_AGENTS_DELETE_SHARED_WORKSPACE_DOCKER_COMMAND_TIMEOUT:-300s}"
1011
OPENCLAW_TEST_STATE_SCRIPT_B64="$(docker_e2e_test_state_shell_b64 agents-delete-shared-workspace empty)"
1112

12-
docker_e2e_build_or_reuse "$IMAGE_NAME" agents-delete-shared-workspace "$ROOT_DIR/Dockerfile" "$ROOT_DIR" "" "$SKIP_BUILD"
13+
docker_e2e_build_or_reuse "$IMAGE_NAME" agents-delete-shared-workspace "$SOURCE_ROOT/Dockerfile" "$SOURCE_ROOT" "" "$SKIP_BUILD"
1314
docker_e2e_harness_mount_args
1415

1516
run_logged agents-delete-shared-workspace docker_e2e_docker_cmd run --rm \

‎scripts/e2e/cli-installer-distribution-docker.sh‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
set -euo pipefail
44

55
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
6+
SOURCE_ROOT="${OPENCLAW_DOCKER_E2E_REPO_ROOT:-$ROOT_DIR}"
67
source "$ROOT_DIR/scripts/lib/docker-e2e-image.sh"
78

89
IMAGE_NAME="$(docker_e2e_resolve_image "openclaw-cli-installer-distribution:local")"
@@ -13,7 +14,7 @@ HOSTED_PROOF_CONTAINER="openclaw-hosted-installer-proof-$$"
1314
SOURCE_PROOF_CONTAINER="openclaw-source-installer-proof-$$"
1415
SOURCE_BUNDLE="$(mktemp "${TMPDIR:-/tmp}/openclaw-source.XXXXXX.bundle")"
1516
SOURCE_PROOF_SCRIPT="$(mktemp "${TMPDIR:-/tmp}/openclaw-source-proof.XXXXXX.sh")"
16-
SOURCE_SHA="$(git -C "$ROOT_DIR" rev-parse HEAD)"
17+
SOURCE_SHA="$(git -C "$SOURCE_ROOT" rev-parse HEAD)"
1718
SOURCE_MEMORY="${OPENCLAW_CLI_INSTALLER_SOURCE_MEMORY:-16g}"
1819

1920
cleanup() {
@@ -25,7 +26,7 @@ cleanup() {
2526
}
2627
trap cleanup EXIT
2728

28-
git -C "$ROOT_DIR" bundle create "$SOURCE_BUNDLE" HEAD
29+
git -C "$SOURCE_ROOT" bundle create "$SOURCE_BUNDLE" HEAD
2930
cat >"$SOURCE_PROOF_SCRIPT" <<'SOURCE_PROOF'
3031
#!/usr/bin/env bash
3132
set -euo pipefail
@@ -86,7 +87,7 @@ docker_e2e_docker_run_cmd run -d \
8687
-e OPENCLAW_NO_ONBOARD=1 \
8788
-e OPENCLAW_NO_PROMPT=1 \
8889
-v "$PACKAGE_TGZ:/tmp/openclaw-current.tgz:ro" \
89-
-v "$ROOT_DIR/scripts/install.sh:/tmp/install.sh:ro" \
90+
-v "$SOURCE_ROOT/scripts/install.sh:/tmp/install.sh:ro" \
9091
"$IMAGE_NAME" \
9192
bash -lc '
9293
set -euo pipefail

‎scripts/e2e/codex-npm-plugin-live-docker.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ if [ -n "$CODEX_PLUGIN_REGISTRY_TARBALL" ]; then
343343
fi
344344
345345
echo "Installing Codex plugin: $CODEX_PLUGIN_SPEC"
346-
openclaw plugins install "$CODEX_PLUGIN_SPEC" "${PLUGIN_INSTALL_FLAGS[@]}" >/tmp/openclaw-codex-plugin-install.log 2>&1
346+
openclaw_e2e_fixture_plugin_command openclaw -- plugins install "$CODEX_PLUGIN_SPEC" "${PLUGIN_INSTALL_FLAGS[@]}" >/tmp/openclaw-codex-plugin-install.log 2>&1
347347
348348
node scripts/e2e/lib/codex-npm-plugin-live/assertions.mjs configure "$MODEL_REF"
349349

‎scripts/e2e/compose-setup.sh‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
set -euo pipefail
33

44
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
5+
SOURCE_ROOT="${OPENCLAW_DOCKER_E2E_REPO_ROOT:-$ROOT_DIR}"
56
source "$ROOT_DIR/scripts/lib/docker-e2e-image.sh"
67

78
IMAGE_NAME="$(docker_e2e_resolve_image "openclaw-docker-e2e-functional:local")"
@@ -17,7 +18,7 @@ COMPOSE=(
1718
docker compose
1819
--project-name "$PROJECT_NAME"
1920
--project-directory "$PROJECT_DIR"
20-
-f "$ROOT_DIR/docker-compose.yml"
21+
-f "$SOURCE_ROOT/docker-compose.yml"
2122
-f "$HEALTH_OVERRIDE_PATH"
2223
)
2324

@@ -56,7 +57,7 @@ NODE
5657
}
5758

5859
assert_dockerfile_healthcheck() {
59-
node - "$ROOT_DIR/Dockerfile" <<'NODE'
60+
node - "$SOURCE_ROOT/Dockerfile" <<'NODE'
6061
const fs = require("node:fs");
6162
const dockerfilePath = process.argv[2];
6263
const dockerfile = fs.readFileSync(dockerfilePath, "utf8").replace(/\\\r?\n[ \t]*/g, " ");

‎scripts/e2e/docker-selected-plugins.sh‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
set -euo pipefail
33

44
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
5+
SOURCE_ROOT="${OPENCLAW_DOCKER_E2E_REPO_ROOT:-$ROOT_DIR}"
56
source "$ROOT_DIR/scripts/lib/docker-build.sh"
67
source "$ROOT_DIR/scripts/lib/docker-e2e-container.sh"
78

@@ -35,8 +36,8 @@ else
3536
env DOCKER_BUILDKIT=1 docker build \
3637
--target workspace-deps \
3738
--build-arg OPENCLAW_EXTENSIONS=missing-plugin \
38-
-f "$ROOT_DIR/Dockerfile" \
39-
"$ROOT_DIR" >"$UNKNOWN_LOG" 2>&1
39+
-f "$SOURCE_ROOT/Dockerfile" \
40+
"$SOURCE_ROOT" >"$UNKNOWN_LOG" 2>&1
4041
unknown_status=$?
4142
set -e
4243
if [ "$unknown_status" -eq 0 ] || ! grep -Fq \
@@ -51,8 +52,8 @@ else
5152
--target workspace-deps \
5253
--build-arg OPENCLAW_EXTENSIONS=whatsapp,kimi \
5354
-t "$DEPENDENCY_ONLY_IMAGE" \
54-
-f "$ROOT_DIR/Dockerfile" \
55-
"$ROOT_DIR"
55+
-f "$SOURCE_ROOT/Dockerfile" \
56+
"$SOURCE_ROOT"
5657
DEPENDENCY_ONLY_IMAGE_BUILT=1
5758
docker_e2e_docker_run_cmd run --rm \
5859
--entrypoint sh \
@@ -65,8 +66,8 @@ else
6566
--build-arg "OPENCLAW_BUILD_TIMESTAMP=$BUILD_TIMESTAMP" \
6667
--build-arg "OPENCLAW_EXTENSIONS=$SELECTED_PLUGINS" \
6768
-t "$IMAGE_NAME" \
68-
-f "$ROOT_DIR/Dockerfile" \
69-
"$ROOT_DIR"
69+
-f "$SOURCE_ROOT/Dockerfile" \
70+
"$SOURCE_ROOT"
7071
fi
7172

7273
echo "Inspecting selected plugins from the final runtime image..."

‎scripts/e2e/kitchen-sink-rpc-walk.mts‎

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
resolveWindowsSystem32Path,
2525
resolveWindowsTaskkillPath,
2626
} from "../lib/windows-taskkill.mjs";
27+
import { fixtureCapabilityConsentArgs } from "./lib/package-compat.mjs";
2728
import { readTextFileTail } from "./lib/text-file-utils.mjs";
2829

2930
type JsonRecord = Record<string, unknown>;
@@ -2754,12 +2755,27 @@ async function main() {
27542755
let sampleTimer: ReturnType<typeof setInterval> | undefined;
27552756
try {
27562757
console.log(`Kitchen Sink RPC walk using ${PLUGIN_SPEC} via ${runner.label}`);
2757-
await runOpenClaw(runner, ["plugins", "install", PLUGIN_SPEC, "--force"], env, {
2758-
...commandResourceOptions,
2759-
requireResourceSample: true,
2760-
resourceLabel: "plugins install",
2761-
timeoutMs: config.installTimeoutMs,
2762-
});
2758+
const installHelp = await runOpenClaw(runner, ["plugins", "install", "--help"], env);
2759+
if (installHelp.stdoutTruncatedChars > 0) {
2760+
throw new Error("Plugin fixture help probe output was truncated");
2761+
}
2762+
await runOpenClaw(
2763+
runner,
2764+
[
2765+
"plugins",
2766+
"install",
2767+
PLUGIN_SPEC,
2768+
"--force",
2769+
...fixtureCapabilityConsentArgs(installHelp.stdout),
2770+
],
2771+
env,
2772+
{
2773+
...commandResourceOptions,
2774+
requireResourceSample: true,
2775+
resourceLabel: "plugins install",
2776+
timeoutMs: config.installTimeoutMs,
2777+
},
2778+
);
27632779
runner = resolveOpenClawRunner();
27642780
console.log(`Kitchen Sink RPC runtime runner: ${runner.label}`);
27652781
configureKitchenSink(env, port);

‎scripts/e2e/lib/codex-media-path/scenario.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ rm -f "$OPENCLAW_CODEX_MEDIA_PATH_APP_SERVER_LOG"
4141
openclaw_e2e_enable_openclaw_cli_timeout
4242

4343
echo "Installing Codex plugin: $PLUGIN_SPEC"
44-
openclaw plugins install "$PLUGIN_SPEC" --force >"$PLUGIN_INSTALL_LOG" 2>&1
44+
openclaw_e2e_fixture_plugin_command openclaw -- plugins install "$PLUGIN_SPEC" --force >"$PLUGIN_INSTALL_LOG" 2>&1
4545
openclaw plugins inspect codex --runtime --json >"$PLUGIN_INSPECT_LOG"
4646

4747
node scripts/e2e/lib/codex-media-path/write-config.mjs

‎scripts/e2e/lib/kitchen-sink-plugin/sweep.sh‎

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,27 @@ print_kitchen_sink_log() {
6161
openclaw_e2e_read_positive_int_env OPENCLAW_DOCKER_E2E_LOG_PRINT_BYTES 65536 >/dev/null
6262

6363
run_kitchen_sink_openclaw_logged() {
64+
local label="$1"
65+
shift
66+
run_kitchen_sink_command_logged "$label" openclaw_e2e_maybe_timeout "$KITCHEN_SINK_CLI_TIMEOUT" node "$OPENCLAW_ENTRY" "$@"
67+
}
68+
69+
run_kitchen_sink_fixture_logged() {
70+
local label="$1"
71+
shift
72+
run_kitchen_sink_command_logged "$label" openclaw_e2e_fixture_plugin_command openclaw_e2e_maybe_timeout "$KITCHEN_SINK_CLI_TIMEOUT" node "$OPENCLAW_ENTRY" -- "$@"
73+
}
74+
75+
run_kitchen_sink_command_logged() {
6476
local label="$1"
6577
shift
6678
local safe_label="${label//[^[:alnum:]._-]/_}"
6779
local log_file="${KITCHEN_SINK_TMP_DIR}/${safe_label}.log"
68-
if ! openclaw_e2e_maybe_timeout "$KITCHEN_SINK_CLI_TIMEOUT" node "$OPENCLAW_ENTRY" "$@" >"$log_file" 2>&1; then
80+
local command_status=0
81+
"$@" >"$log_file" 2>&1 || command_status=$?
82+
if [[ "$command_status" -ne 0 ]]; then
6983
print_kitchen_sink_log "$log_file"
70-
return 1
84+
return "$command_status"
7185
fi
7286
print_kitchen_sink_log "$log_file"
7387
}
@@ -155,11 +169,11 @@ run_success_scenario() {
155169
echo "Testing ${KITCHEN_SINK_LABEL} install from ${KITCHEN_SINK_SPEC}..."
156170
local install_args=("$KITCHEN_SINK_SPEC")
157171
if [ -n "${KITCHEN_SINK_PREINSTALL_SPEC:-}" ]; then
158-
run_kitchen_sink_openclaw_logged "kitchen-sink-preinstall-${KITCHEN_SINK_LABEL}" plugins install "$KITCHEN_SINK_PREINSTALL_SPEC" --force
172+
run_kitchen_sink_fixture_logged "kitchen-sink-preinstall-${KITCHEN_SINK_LABEL}" plugins install "$KITCHEN_SINK_PREINSTALL_SPEC" --force
159173
assert_kitchen_sink_cutover_preinstalled
160174
install_args+=("--force")
161175
fi
162-
run_kitchen_sink_openclaw_logged "kitchen-sink-install-${KITCHEN_SINK_LABEL}" plugins install "${install_args[@]}" --force
176+
run_kitchen_sink_fixture_logged "kitchen-sink-install-${KITCHEN_SINK_LABEL}" plugins install "${install_args[@]}" --force
163177
configure_kitchen_sink_runtime
164178
run_kitchen_sink_openclaw_logged "kitchen-sink-enable-${KITCHEN_SINK_LABEL}" plugins enable "$KITCHEN_SINK_ID"
165179
run_kitchen_sink_openclaw_capture "${KITCHEN_SINK_TMP_DIR}/kitchen-sink-${KITCHEN_SINK_LABEL}-plugins.json" plugins list --json

‎scripts/e2e/lib/package-compat.mjs‎

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
// Package-version compatibility helpers for E2E acceptance scripts.
1+
// Candidate-package compatibility helpers for E2E acceptance scripts.
2+
import { readFileSync } from "node:fs";
3+
import { stripVTControlCharacters } from "node:util";
24
import { isDirectRunUrl } from "../../lib/direct-run.mjs";
35

46
export function legacyPackageAcceptanceCompat(version) {
@@ -9,6 +11,20 @@ export function legacyPackageAcceptanceCompat(version) {
911
);
1012
}
1113

14+
// Candidates on either side of consent enforcement can share a package version.
15+
// Only successful command help establishes support; callers own probe failures.
16+
export function fixtureCapabilityConsentArgs(help) {
17+
return /^[\t ]*--accept-capabilities(?:[\t ]|$)/m.test(stripVTControlCharacters(help))
18+
? ["--accept-capabilities"]
19+
: [];
20+
}
21+
1222
if (isDirectRunUrl(process.argv[1], import.meta.url)) {
13-
console.log(legacyPackageAcceptanceCompat(process.argv[2]) ? "1" : "0");
23+
console.log(
24+
process.argv[2] === "fixture-consent"
25+
? fixtureCapabilityConsentArgs(readFileSync(0, "utf8")).join("\n")
26+
: legacyPackageAcceptanceCompat(process.argv[2])
27+
? "1"
28+
: "0",
29+
);
1430
}

‎scripts/e2e/lib/plugins/clawhub.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ run_plugins_clawhub_scenario() {
5656

5757
node scripts/e2e/lib/plugins/assertions.mjs clawhub-preflight
5858

59-
run_plugins_openclaw_logged install-clawhub plugins install "$CLAWHUB_PLUGIN_SPEC"
59+
run_plugins_fixture_logged install-clawhub plugins install "$CLAWHUB_PLUGIN_SPEC"
6060
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-clawhub-installed.json" plugins list --json
6161
run_plugins_openclaw_capture "$OPENCLAW_PLUGINS_TMP_DIR/plugins-clawhub-inspect.json" plugins inspect "$CLAWHUB_PLUGIN_ID" --json
6262

0 commit comments

Comments
 (0)