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:
parent
32a3016f0d
commit
4c83e0d2bf
|
|
@ -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"
|
||||
|
|
|
|||
Reference in New Issue