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 <noreply@anthropic.com>
This commit is contained in:
Levi Neely 2026-03-15 07:54:38 +01:00
parent 32a3016f0d
commit 4c83e0d2bf
1 changed files with 4 additions and 1 deletions

View File

@ -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"