openclaw/scripts/e2e/session-runtime-context-docker.sh
Peter Steinberger 31848a1520
fix: keep cold sessions visible and verify release recovery (#145462)
* test: cover transcript cold storage in release Docker lanes

* test: remove stale cloud picker test seams

Clear baseline CI failures introduced by #145183: reuse the existing picker fixture, test cloud configuration through its production renderer, and remove the unused Connect menu renderer.

* test: preserve historical transcript fixture modification times

Doctor imports filesystem mutation time rather than timestamps inside messages. Date the legacy files before import, and handle CLI failure diagnostics without adding a lint suppression or retaining credential-bearing command arguments.

* fix: keep cold sessions available to Activity title probes

Handle cold transcripts at the optional title-reader boundary without restoring payloads or caching missing previews. Verify real archival, mixed hot/cold listings and cache recovery; extend packaged release proof across restart and portable backup recovery. Preserve JSON CLI errors from stdout in the test harness.

* fix(ui): use the action cursor for session details

Clear the existing cursor-policy failure from #145183 without weakening its regression test.

* test: preserve frozen release targets in cold-storage lanes

Share capability resolution with source preflight and omit only unsupported cold subcases under the existing explicit frozen-target policy. Keep current coverage required, isolate ordinary retention in the live fixture, and strengthen fixture typing without suppressions.

* test: complete cold-storage release entrypoint contracts

Register the shell entrypoints for dependency analysis, type the frozen-source fixture cases explicitly, and align existing cloud test callback ordering with the same repair now on main.

* test: isolate archived recall from external tool policy

* test: retain the cloud machine locator for proof capture
2026-09-11 20:25:40 -07:00

45 lines
2 KiB
Bash

#!/usr/bin/env bash
# Bash 5.3+ can deadlock writing heredoc pipes on macOS before the reader starts.
if [[ ${OSTYPE:-} == darwin* && $BASH != /bin/bash ]] && ((BASH_VERSINFO[0] > 5 || (BASH_VERSINFO[0] == 5 && BASH_VERSINFO[1] >= 3))); then
exec /bin/bash "$0" "$@"
fi
# Verifies hidden runtime context transcript persistence in Docker using the
# package-installed functional E2E image.
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/frozen-target-compat.sh"
openclaw_resolve_frozen_runtime_context_contract "${OPENCLAW_DOCKER_E2E_REPO_ROOT:-$ROOT_DIR}"
openclaw_resolve_frozen_session_cold_storage_contract "${OPENCLAW_DOCKER_E2E_REPO_ROOT:-$ROOT_DIR}"
IMAGE_NAME="$(docker_e2e_resolve_image "openclaw-session-runtime-context-e2e" OPENCLAW_SESSION_RUNTIME_CONTEXT_E2E_IMAGE)"
CONTAINER_NAME="openclaw-session-runtime-context-e2e-$$"
RUN_LOG="$(mktemp -t openclaw-session-runtime-context-log.XXXXXX)"
trap 'docker_e2e_cleanup_container_run "$CONTAINER_NAME" "$RUN_LOG"' EXIT
docker_e2e_build_or_reuse "$IMAGE_NAME" session-runtime-context
echo "Running session runtime context Docker E2E..."
# Harness files are mounted read-only; the app under test comes from /app/dist.
set +e
docker_e2e_run_with_harness \
--name "$CONTAINER_NAME" \
-e COREPACK_ENABLE_DOWNLOAD_PROMPT=0 \
-e "OPENCLAW_FROZEN_TARGET_RUNTIME_CONTEXT_INPUT_MODE=$OPENCLAW_FROZEN_TARGET_RUNTIME_CONTEXT_INPUT_MODE" \
-e "OPENCLAW_FROZEN_TARGET_SESSION_REPAIR_MODE=$OPENCLAW_FROZEN_TARGET_SESSION_REPAIR_MODE" \
-e "OPENCLAW_FROZEN_TARGET_SESSION_COLD_STORAGE_MODE=$OPENCLAW_FROZEN_TARGET_SESSION_COLD_STORAGE_MODE" \
"$IMAGE_NAME" \
bash -lc 'set -euo pipefail; tsx scripts/e2e/session-runtime-context-docker-client.ts; bash scripts/e2e/lib/session-cold-storage/scenario.sh' \
>"$RUN_LOG" 2>&1
status=$?
set -e
if [ "$status" -ne 0 ]; then
echo "Docker session runtime context smoke failed"
docker_e2e_print_log "$RUN_LOG"
exit "$status"
fi
echo "OK"