From 8d3be74fd2af9d3f600b7c838bc823c67bb9a672 Mon Sep 17 00:00:00 2001 From: damocles Date: Thu, 21 May 2026 23:13:23 +0200 Subject: [PATCH] =?UTF-8?q?harness:=20fix=20hive-dashboard-links=20state?= =?UTF-8?q?=20dir=20=E2=80=94=20drop=20legacy=20/state,=20use=20/agents/*/?= =?UTF-8?q?state?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nix/templates/harness-base.nix | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/nix/templates/harness-base.nix b/nix/templates/harness-base.nix index dfc9bde..359adc3 100644 --- a/nix/templates/harness-base.nix +++ b/nix/templates/harness-base.nix @@ -525,15 +525,11 @@ }; environment.LINKS_JSON = builtins.toJSON config.hyperhive.dashboardLinks; script = '' - STATE_DIR="" - for d in /state /agents/*/state; do - if [ -d "$d" ]; then - STATE_DIR="$d" - break - fi - done - if [ -z "$STATE_DIR" ]; then - echo "hive-dashboard-links: no state dir found; skipping" + # Sub-agents have their state dir bind-mounted at /agents//state. + # Use a glob — exactly one match per container at runtime. + STATE_DIR=$(echo /agents/*/state) + if [ ! -d "$STATE_DIR" ]; then + echo "hive-dashboard-links: no state dir found at /agents/*/state; skipping" exit 0 fi printf '%s' "$LINKS_JSON" > "$STATE_DIR/hyperhive-dashboard-links.json"