From a3ccdf4e526fa505a89e71ab245860ddc3f968f9 Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Sat, 14 Mar 2026 20:39:13 +0100 Subject: [PATCH] wait_for_bead: fix pipe subshell exit leaving 9p read orphaned Use process substitution instead of pipe so exit 0 terminates the script and its file descriptor, killing the 9p read process cleanly. Co-Authored-By: Claude Sonnet 4.6 --- mcptools/wait_for_bead.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mcptools/wait_for_bead.sh b/mcptools/wait_for_bead.sh index b0530f1..018ced6 100755 --- a/mcptools/wait_for_bead.sh +++ b/mcptools/wait_for_bead.sh @@ -22,7 +22,7 @@ fi EXPECTED_SOURCE="beads/$MOUNT" -9p read anvillm/events | while IFS= read -r line; do +while IFS= read -r line; do type=$(echo "$line" | jq -r '.type // empty' 2>/dev/null) [ "$type" = "BeadReady" ] || continue @@ -43,4 +43,4 @@ EXPECTED_SOURCE="beads/$MOUNT" # Emit full bead data and exit echo "$line" | jq '.data' exit 0 -done +done < <(9p read anvillm/events)