From 07a7abb2485d895bc1385e375e884e42b717e669 Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Sat, 14 Mar 2026 21:36:54 +0100 Subject: [PATCH] =?UTF-8?q?wait=5Ffor=5Fbead:=20remove=20role=20filter=20?= =?UTF-8?q?=E2=80=94=20bot=20decides=20whether=20to=20claim?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Role filtering was silently dropping events when $AGENT_ROLE didn't match the default "developer". The bot already handles out-of-scope work refusal — no need to filter here. Co-Authored-By: Claude Sonnet 4.6 --- mcptools/wait_for_bead.sh | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/mcptools/wait_for_bead.sh b/mcptools/wait_for_bead.sh index 018ced6..e3a309a 100755 --- a/mcptools/wait_for_bead.sh +++ b/mcptools/wait_for_bead.sh @@ -1,22 +1,20 @@ #!/bin/bash # capabilities: beads -# description: Block until a bead matching --mount and --role is ready, then print its full JSON (including comments) and exit. Uses the anvillm/events stream — no polling. -# Usage: wait_for_bead.sh --mount [--role ] +# description: Block until a bead is ready on the given mount, then print its full JSON (including comments) and exit. Uses the anvillm/events stream — no polling. +# Usage: wait_for_bead.sh --mount set -euo pipefail MOUNT="" -ROLE="${AGENT_ROLE:-developer}" while [[ $# -gt 0 ]]; do case "$1" in --mount) MOUNT="$2"; shift 2 ;; - --role) ROLE="$2"; shift 2 ;; *) echo "unknown argument: $1" >&2; exit 1 ;; esac done if [ -z "$MOUNT" ]; then - echo "usage: wait_for_bead.sh --mount [--role ]" >&2 + echo "usage: wait_for_bead.sh --mount " >&2 exit 1 fi @@ -29,18 +27,7 @@ while IFS= read -r line; do source=$(echo "$line" | jq -r '.source // empty' 2>/dev/null) [ "$source" = "$EXPECTED_SOURCE" ] || continue - # Check role label matches (format: "role:") - bead_role=$(echo "$line" | jq -r ' - .data.labels // [] | - map(select(startswith("role:"))) | - first // "" | - ltrimstr("role:") - ' 2>/dev/null) - # Default to "developer" if no role label - [ -z "$bead_role" ] && bead_role="developer" - [ "$bead_role" = "$ROLE" ] || continue - - # Emit full bead data and exit + # Emit full bead data and exit — bot decides whether to claim echo "$line" | jq '.data' exit 0 done < <(9p read anvillm/events)