#!/bin/bash
run_repo="$HOME/runs/run-20260822T102540Z-10hhh6/repo"
run_state="$HOME/runs/run-20260822T102540Z-10hhh6/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; mise x node@22 -- pnpm install --frozen-lockfile >/dev/null; mise x node@22 -- pnpm typecheck >/dev/null; mise x node@22 -- pnpm vitest run tests/providers/agent-acp/agent-acp.test.ts tests/gateway/model-gateway.test.ts tests/application/execution-dispatch-idempotency.test.ts tests/application/execution-retry.test.ts
)
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
