From 91eeca0aaac4f59413913076b0bece12a9c16b03 Mon Sep 17 00:00:00 2001 From: Natalie Date: Sat, 16 May 2026 23:16:39 -0700 Subject: [PATCH] =?UTF-8?q?feat(@projects/@magic-civilization):=20?= =?UTF-8?q?=E2=9C=A8=20add=20godot=20process=20tracking?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- scripts/apricot-run.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/scripts/apricot-run.sh b/scripts/apricot-run.sh index 4aa8e9e0..b331befc 100755 --- a/scripts/apricot-run.sh +++ b/scripts/apricot-run.sh @@ -292,14 +292,21 @@ if [[ "${MODE}" == "status" ]]; then exit 0 fi - IFS='|' read -r IS_ACTIVE MARKER_COUNT STATS_COUNT SEEDS_TOTAL <<<"${PROBE_OUT}" + IFS='|' read -r IS_ACTIVE MARKER_COUNT STATS_COUNT SEEDS_TOTAL GODOT_PROCS <<<"${PROBE_OUT}" MARKER_COUNT="${MARKER_COUNT:-0}" STATS_COUNT="${STATS_COUNT:-0}" SEEDS_TOTAL="${SEEDS_TOTAL:-0}" + GODOT_PROCS="${GODOT_PROCS:-0}" - if [[ "${MARKER_COUNT}" -gt 0 ]]; then + if [[ "${MARKER_COUNT}" -gt 0 && "${GODOT_PROCS}" -eq 0 ]]; then STATE="complete" MARKER_BOOL="true" + elif [[ "${MARKER_COUNT}" -gt 0 && "${GODOT_PROCS}" -gt 0 ]]; then + # Batch script returned (touched completion.marker) but flatpak- + # detached godot processes are still playing games. Status remains + # `running` so `fetch` won't pull mid-run turn_stats snapshots. + STATE="running" + MARKER_BOOL="true" elif [[ "${IS_ACTIVE}" == "active" || "${IS_ACTIVE}" == "activating" ]]; then STATE="running" MARKER_BOOL="false" @@ -308,8 +315,8 @@ if [[ "${MODE}" == "status" ]]; then MARKER_BOOL="false" fi - printf '{"stamp":"%s","state":"%s","seeds_done":%s,"seeds_total":%s,"completion_marker":%s}\n' \ - "${QUERY_STAMP}" "${STATE}" "${STATS_COUNT}" "${SEEDS_TOTAL}" "${MARKER_BOOL}" + printf '{"stamp":"%s","state":"%s","seeds_done":%s,"seeds_total":%s,"completion_marker":%s,"godot_procs":%s}\n' \ + "${QUERY_STAMP}" "${STATE}" "${STATS_COUNT}" "${SEEDS_TOTAL}" "${MARKER_BOOL}" "${GODOT_PROCS}" exit 0 fi