#!/bin/bash
run_repo="$HOME/runs/run-20260823T164646Z-75fi4z/repo"
run_state="$HOME/runs/run-20260823T164646Z-75fi4z/state"
cd "$run_repo" || exit 97
exec > >(tee -a "$run_state/output.log") 2>&1
export PATH="$PATH:$HOME/.claude/bin:$HOME/.local/bin"
export HARNESS_CHILD_SLICE='agent-run.slice'
export RUN_REMOTE_PLACED='1'
set +e
(
/home/user/.claude/bin/e2e-remote --server tests/e2e/remote-stack.sh --wait-port 8080 --env WP_BASE_URL=http://127.0.0.1:8080 -- /home/user/.local/share/mise/installs/pnpm/11.5.2/pnpm --dir tests/e2e exec playwright test --config=playwright.config.js metabox-translate.spec.js --project=chromium --project=firefox
)
rc=$?
printf "%s" "$rc" > "$run_state/exit-code.tmp"
mv "$run_state/exit-code.tmp" "$run_state/exit-code"
printf "\n[run-remote] finished rc=%s\n" "$rc"
exit $rc
