From 8ccd524f7dfc842bbd43ab7f964a50888d44c54b Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Sat, 14 Mar 2026 16:02:42 +0100 Subject: [PATCH] claim_bead: use $AGENT_ID instead of --assignee flag The bot claiming a bead is always the bot working on it. Remove the --assignee flag; AGENT_ID is required in the environment. Co-Authored-By: Claude Sonnet 4.6 --- mcptools/claim_bead.sh | 23 +++++++++++------------ skills/beads/SKILL.md | 3 ++- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/mcptools/claim_bead.sh b/mcptools/claim_bead.sh index 9057713..6214c0d 100755 --- a/mcptools/claim_bead.sh +++ b/mcptools/claim_bead.sh @@ -1,31 +1,30 @@ #!/bin/bash # capabilities: beads -# description: Claim a bead for work -# Usage: claim_bead.sh --mount --id [--assignee ] +# description: Claim a bead for work. Assignee is taken from $AGENT_ID. +# Usage: claim_bead.sh --mount --id set -euo pipefail MOUNT="" BEAD_ID="" -ASSIGNEE="" while [[ $# -gt 0 ]]; do case "$1" in - --mount) MOUNT="$2"; shift 2 ;; - --id) BEAD_ID="$2"; shift 2 ;; - --assignee) ASSIGNEE="$2"; shift 2 ;; + --mount) MOUNT="$2"; shift 2 ;; + --id) BEAD_ID="$2"; shift 2 ;; *) echo "unknown argument: $1" >&2; exit 1 ;; esac done if [ -z "$MOUNT" ] || [ -z "$BEAD_ID" ]; then - echo "usage: claim_bead.sh --mount --id [--assignee ]" >&2 + echo "usage: claim_bead.sh --mount --id " >&2 exit 1 fi -if [ -n "$ASSIGNEE" ]; then - echo "claim $BEAD_ID $ASSIGNEE" | 9p write anvillm/beads/$MOUNT/ctl -else - echo "claim $BEAD_ID" | 9p write anvillm/beads/$MOUNT/ctl +if [ -z "${AGENT_ID:-}" ]; then + echo "error: AGENT_ID is not set" >&2 + exit 1 fi -echo "claimed $BEAD_ID${ASSIGNEE:+ → $ASSIGNEE}" + +echo "claim $BEAD_ID $AGENT_ID" | 9p write anvillm/beads/$MOUNT/ctl +echo "claimed $BEAD_ID → $AGENT_ID" diff --git a/skills/beads/SKILL.md b/skills/beads/SKILL.md index 31bf7ce..0f991cd 100644 --- a/skills/beads/SKILL.md +++ b/skills/beads/SKILL.md @@ -81,8 +81,9 @@ Claim bead: ``` Tool: execute_code tool: claim_bead.sh -args: ["--mount", "", "--id", "", "--assignee", "$AGENT_ID"] +args: ["--mount", "", "--id", ""] ``` +Assignee is taken automatically from `$AGENT_ID` in the environment. Complete bead: ```