From 4c83e0d2bfe5d5b63287c79f01fbda66ed9d2715 Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Sun, 15 Mar 2026 07:54:38 +0100 Subject: [PATCH] claim_bead: exit 1 on failed ctl write instead of printing success 9p write error was ignored; bots always printed "claimed" regardless of whether the server rejected the claim with ErrAlreadyClaimed. Co-Authored-By: Claude Sonnet 4.6 --- mcptools/claim_bead.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mcptools/claim_bead.sh b/mcptools/claim_bead.sh index 6214c0d..2d67291 100755 --- a/mcptools/claim_bead.sh +++ b/mcptools/claim_bead.sh @@ -26,5 +26,8 @@ if [ -z "${AGENT_ID:-}" ]; then exit 1 fi -echo "claim $BEAD_ID $AGENT_ID" | 9p write anvillm/beads/$MOUNT/ctl +if ! result=$(echo "claim $BEAD_ID $AGENT_ID" | 9p write anvillm/beads/$MOUNT/ctl 2>&1); then + echo "error: claim failed: $result" >&2 + exit 1 +fi echo "claimed $BEAD_ID → $AGENT_ID"