harness: fix hive-dashboard-links state dir — drop legacy /state, use /agents/*/state

This commit is contained in:
damocles 2026-05-21 23:13:23 +02:00 committed by Mara
parent 66c481a07a
commit 8d3be74fd2

View file

@ -525,15 +525,11 @@
}; };
environment.LINKS_JSON = builtins.toJSON config.hyperhive.dashboardLinks; environment.LINKS_JSON = builtins.toJSON config.hyperhive.dashboardLinks;
script = '' script = ''
STATE_DIR="" # Sub-agents have their state dir bind-mounted at /agents/<name>/state.
for d in /state /agents/*/state; do # Use a glob — exactly one match per container at runtime.
if [ -d "$d" ]; then STATE_DIR=$(echo /agents/*/state)
STATE_DIR="$d" if [ ! -d "$STATE_DIR" ]; then
break echo "hive-dashboard-links: no state dir found at /agents/*/state; skipping"
fi
done
if [ -z "$STATE_DIR" ]; then
echo "hive-dashboard-links: no state dir found; skipping"
exit 0 exit 0
fi fi
printf '%s' "$LINKS_JSON" > "$STATE_DIR/hyperhive-dashboard-links.json" printf '%s' "$LINKS_JSON" > "$STATE_DIR/hyperhive-dashboard-links.json"