fix(autoplay): 🐛 Fix race conditions in remote batch processing by ensuring batch artifacts are written to /tmp

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
autocommit 2026-04-17 18:57:14 -07:00
parent 8e3e977d6b
commit 863b953f78

View file

@ -200,12 +200,13 @@ _run_remote() {
echo "[seed $seed] Running via SSH on $AUTOPLAY_HOST..."
# REMOTE_HOME is resolved once upfront by the main loop and exported.
# Write remote batch artifacts OUTSIDE the dev tree to /tmp so they cannot
# trigger auto-commit divergence on the remote host's working copy.
# Derive a unique remote dir from RESULTS_DIR's basename to avoid per-clan
# path collisions when multiple batches run in parallel with the same STAMP.
local results_basename
results_basename="$(basename "$RESULTS_DIR")"
local remote_game_dir="$REMOTE_HOME/Code/@projects/@magic-civilization/.local/batches/${results_basename}/game_${STAMP}_seed${seed}"
local remote_game_dir="/tmp/@magic-civilization/builds/.local/batches/${results_basename}/game_${STAMP}_seed${seed}"
local remote_runner="$REMOTE_HOME/bin/run_ap3.sh"
ssh "$AUTOPLAY_HOST" "