#!/bin/bash
run_repo="$HOME/runs/run-20260822T110202Z-56zhq0/repo"
run_state="$HOME/runs/run-20260822T110202Z-56zhq0/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
(
set -eu; echo image:; sudo -n /usr/local/bin/k3s ctr images list -q | grep 'localhost/awp-agent-runner:b149e45cba7b' || true; echo label:; kubectl get node debian1 --show-labels | tr ',' '\n' | grep 'awp.platform/agent-runner' || true
)
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
