From 2fef99c12415cc814d042d27438aedaa225c82de Mon Sep 17 00:00:00 2001 From: Natalie Date: Tue, 14 Apr 2026 19:48:40 -0700 Subject: [PATCH] =?UTF-8?q?feat(engine):=20=E2=9C=A8=20add=20turn=20limit?= =?UTF-8?q?=20support=20in=20auto-play?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- src/game/engine/scenes/tests/auto_play.gd | 5 ++++- tools/autoplay-batch.sh | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/game/engine/scenes/tests/auto_play.gd b/src/game/engine/scenes/tests/auto_play.gd index 2bd61b69..26a2bdae 100644 --- a/src/game/engine/scenes/tests/auto_play.gd +++ b/src/game/engine/scenes/tests/auto_play.gd @@ -70,7 +70,10 @@ func _ready() -> void: return _output_dir = EnvConfig.get_var("AUTO_PLAY_DIR", "/tmp") DirAccess.make_dir_recursive_absolute(_output_dir) - print("AutoPlay: active — output to %s" % _output_dir) + var limit_str: String = EnvConfig.get_var("AUTO_PLAY_TURN_LIMIT", "") + if not limit_str.is_empty() and limit_str.is_valid_int(): + _max_turns = int(limit_str) + print("AutoPlay: active — output to %s, max_turns=%d" % [_output_dir, _max_turns]) # Seeded determinism — only when AUTO_PLAY_SEED is set var seed_str: String = EnvConfig.get_var("AUTO_PLAY_SEED", "") diff --git a/tools/autoplay-batch.sh b/tools/autoplay-batch.sh index f9166202..3595aba1 100755 --- a/tools/autoplay-batch.sh +++ b/tools/autoplay-batch.sh @@ -115,7 +115,11 @@ _run_remote() { echo "[seed $seed] Running via SSH on $AUTOPLAY_HOST..." - local remote_game_dir="\$HOME/tmp/autoplay_batch/game_${STAMP}_seed${seed}" + # Resolve remote $HOME once so we don't fight quoting rules + if [ -z "${REMOTE_HOME:-}" ]; then + REMOTE_HOME="$(ssh "$AUTOPLAY_HOST" 'echo "$HOME"')" + fi + local remote_game_dir="$REMOTE_HOME/tmp/autoplay_batch/game_${STAMP}_seed${seed}" ssh "$AUTOPLAY_HOST" " set -euo pipefail @@ -134,7 +138,7 @@ _run_remote() { } echo "[seed $seed] Fetching results from $AUTOPLAY_HOST..." - scp -r "$AUTOPLAY_HOST:\$HOME/tmp/autoplay_batch/game_${STAMP}_seed${seed}/." "$game_dir/" \ + scp -r "$AUTOPLAY_HOST:$remote_game_dir/." "$game_dir/" \ >/dev/null 2>&1 || { echo "WARNING: scp failed for seed $seed — result may be missing" >&2 }