Files
openclaw/scripts/e2e/plugin-update-unchanged-docker.sh
Dallin RomneyandPeter Steinberger 3ab172649f fix(update): preserve explicit plugin capability consent (#131301)
* fix(update): preserve explicit plugin capability consent

* fix(update): bind plugin consent to staged artifacts

Use the canonical artifact consent adapter for channel migrations and preserve
explicit consent through the update wizard. Keep prior usable payloads on denial
and record the exact accepted surface through the existing install-record owner.

Cover parser boundaries, staged artifact changes, and packaged update/repair
handoffs without treating --yes as consent or granting future permission.

Co-authored-by: Dallin Romney <dallinromney@gmail.com>

* test(update): register consent scenario with probe

Route the packaged consent scenario through the existing plugin-update probe
so Knip discovers the implementation through its normal entry graph. Initialize
scenario state only when the consent command runs, preserving other probe modes.

Co-authored-by: Dallin Romney <dallinromney@gmail.com>

* fix(update): retain consent with compatible finalizers

Inspect the installed update command before forwarding explicit consent so
older and same-version target CLIs keep finalization in the existing parent
path when they lack the option. Preserve the installed compatibility host
through plugin convergence and reuse the update step timeout for inspection.

Use built-in streaming SHA256 for the packaged proof rather than requiring
an undeclared checksum binary.

Co-authored-by: Dallin Romney <dallinromney@gmail.com>

* fix(update): keep convergence code loaded across replacement

Link the mandatory registry repair before the core package swap removes the
old updater's chunks. This keeps current-process finalization runnable when
the installed target cannot receive explicit capability consent, without
retaining old runtime files or changing plugin policy.

Co-authored-by: Dallin Romney <dallinromney@gmail.com>

* test(cli): await MCP Doctor batch readiness

Synchronize the concurrency test at the fourth credential check instead of
polling command startup with a wall-clock deadline. Release blocked checks
and await Doctor in finally, including early command or assertion failures.
Keep the exact concurrency, total-check and sorted-result assertions.

Co-authored-by: Dallin Romney <dallinromney@gmail.com>

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
Co-authored-by: Dallin Romney <dallinromney@gmail.com>
2026-08-28 08:25:06 -07:00

38 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
# Verifies unchanged plugin updates and explicit capability consent during update/repair.
# The CLI under test is installed from the prepared npm tarball in a bare runner.
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
source "$ROOT_DIR/scripts/lib/docker-e2e-image.sh"
source "$ROOT_DIR/scripts/lib/docker-e2e-package.sh"
IMAGE_NAME="$(docker_e2e_resolve_image "openclaw-plugin-update-e2e" OPENCLAW_PLUGIN_UPDATE_E2E_IMAGE)"
SKIP_BUILD="${OPENCLAW_PLUGIN_UPDATE_E2E_SKIP_BUILD:-0}"
cleanup() {
docker_e2e_cleanup_package_tgz "${PACKAGE_TGZ:-}"
}
trap cleanup EXIT
PACKAGE_TGZ="$(docker_e2e_prepare_package_tgz plugin-update "${OPENCLAW_CURRENT_PACKAGE_TGZ:-}")"
# Bare lanes mount the package artifact instead of baking app sources into the image.
docker_e2e_package_mount_args "$PACKAGE_TGZ"
docker_e2e_build_or_reuse "$IMAGE_NAME" plugin-update "$ROOT_DIR/scripts/e2e/Dockerfile" "$ROOT_DIR" "bare" "$SKIP_BUILD"
OPENCLAW_TEST_STATE_SCRIPT_B64="$(docker_e2e_test_state_shell_b64 plugin-update empty)"
echo "Running unchanged plugin update and capability consent smoke..."
docker_e2e_run_with_harness \
-e COREPACK_ENABLE_DOWNLOAD_PROMPT=0 \
-e OPENCLAW_SKIP_CHANNELS=1 \
-e OPENCLAW_SKIP_PROVIDERS=1 \
-e "OPENCLAW_TEST_STATE_SCRIPT_B64=$OPENCLAW_TEST_STATE_SCRIPT_B64" \
"${DOCKER_E2E_PACKAGE_ARGS[@]}" \
"$IMAGE_NAME" \
bash -e -c '
bash scripts/e2e/lib/plugin-update/consent-scenario.sh
bash scripts/e2e/lib/plugin-update/unchanged-scenario.sh
'
echo "Plugin update unchanged and consent Docker E2E passed."