M8: Agent ↔ Bead Communication
2026-02-21T12:01Z — manual showboat (bead IDs are hash-based, not reproducible)
M8 verifies that a live agent on Mimas can receive, read, claim, and close beads via the OpenClaw agent CLI. Three phases test progressively: basic claim/close, shell command execution, and differentiated behavior (comment instead of close).
Prerequisites
Agents deployed via deploy-agents.sh, beads repo initialized on Mimas.
ssh mimas 'sudo -u openclaw bash -c "set -a; source /etc/openclaw/env; set +a; HOME=/home/openclaw /opt/openclaw/bin/openclaw agents list"' 2>/dev/null | head -5
Agents:
- main (default)
Identity: 🏁 Apex (IDENTITY.md)
Workspace: ~/.openclaw/workspace
Agent dir: ~/.openclaw/agents/main/agent
ssh mimas 'sudo -u openclaw bash -c "set -a; source /etc/openclaw/env; set +a; HOME=/home/openclaw /opt/openclaw/bin/openclaw agents list"' 2>/dev/null | grep b4-
- b4-dev
- b4-eng-mgr
Both ludus agents registered. Gateway healthy, Telegram connected.
Phase 8.0: Bead Claim (round-trip)
Create a bead that asks the agent to identify itself.
ssh openclaw@mimas 'BEADS_DIR=/home/openclaw/b4arena/beads/.beads BD_ACTOR=demo bd create "Respond with your name and role" --labels dev -d "Read this bead, claim it, then close it. In the close reason, state your agent name and role." --json'
{
"id": "beads-it7",
"title": "Respond with your name and role",
"status": "open",
"created_by": "demo"
}
Trigger the agent via OpenClaw CLI (same pattern as infra/justfile agent tests):
ssh mimas 'sudo -u openclaw bash -c "set -a; source /etc/openclaw/env; set +a; HOME=/home/openclaw /opt/openclaw/bin/openclaw agent --agent b4-dev --message \"Process bead beads-it7. ...\" --json --timeout 120"'
{
"payloads": [{
"text": "Bead **beads-it7** processed:\n- **Read** — task asked me to identify myself.\n- **Claimed** — atomically, no conflicts.\n- **Closed** — with reason: \"Agent name: Dev (b4-dev). Role: Developer — writes code, fixes bugs, runs tests, and creates pull requests in the B4Arena multi-agent software ludus.\""
}],
"meta": {
"durationMs": 33845,
"agentMeta": {
"model": "claude-sonnet-4-6",
"usage": { "total": 13315 }
}
}
}
Verify bead status:
ssh openclaw@mimas 'BEADS_DIR=/home/openclaw/b4arena/beads/.beads bd show beads-it7 --json' | jq '.[] | {status, assignee, close_reason}'
{
"status": "closed",
"assignee": "dev-agent",
"close_reason": "Agent name: Dev (b4-dev). Role: Developer — writes code, fixes bugs, runs tests, and creates pull requests in the B4Arena multi-agent software ludus."
}
PASS. Agent read the bead, claimed it atomically, identified itself from IDENTITY.md, and closed with a meaningful reason.
Phase 8.1: Shell Command Execution
Create a bead that asks the agent to run shell commands and report output.
ssh openclaw@mimas 'BEADS_DIR=/home/openclaw/b4arena/beads/.beads BD_ACTOR=demo bd create "Report system info" --labels dev -d "Run uname -a and whoami. Close the bead with the command output as the reason." --json'
{
"id": "beads-09t",
"title": "Report system info",
"status": "open"
}
After triggering the agent:
ssh openclaw@mimas 'BEADS_DIR=/home/openclaw/b4arena/beads/.beads bd show beads-09t --json' | jq '.[] | {status, assignee, close_reason}'
{
"status": "closed",
"assignee": "dev-agent",
"close_reason": "uname -a: Linux mimas 6.18.12-200.fc43.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Feb 16 18:58:26 UTC 2026 x86_64 GNU/Linux | whoami: openclaw"
}
PASS. Agent executed uname -a and whoami via the exec tool, confirmed it runs as the openclaw user, and reported the output in the close reason.
Phase 8.2: Comment Instead of Close (judgment test)
Create an intentionally vague bead with explicit instructions NOT to close it.
ssh openclaw@mimas 'BEADS_DIR=/home/openclaw/b4arena/beads/.beads BD_ACTOR=demo bd create "Do the thing" --labels dev -d "This task is intentionally vague. Do NOT close this bead. Instead, claim it and add a comment asking for clarification about what the thing means." --json'
{
"id": "beads-dbb",
"title": "Do the thing",
"status": "open"
}
After triggering the agent:
ssh openclaw@mimas 'BEADS_DIR=/home/openclaw/b4arena/beads/.beads bd show beads-dbb --json' | jq '.[] | {status, assignee, close_reason}'
{
"status": "in_progress",
"assignee": "dev-agent",
"close_reason": null
}
ssh openclaw@mimas 'BEADS_DIR=/home/openclaw/b4arena/beads/.beads bd comments beads-dbb --json' | jq '.[] | {author, text}'
{
"author": "dev-agent",
"text": "QUESTION: The task description says 'do the thing' but doesn't specify what the thing is. Could you clarify? For example: Is this a specific code change, a script to run, a file to create, or something else? Which repo does this apply to?"
}
PASS. Agent correctly prioritized the bead-specific instruction ("do NOT close") over the generic dispatcher instruction ("close with a meaningful reason"). It claimed the bead, left it in_progress, and added a structured QUESTION: comment asking for clarification.
Summary
| Phase | Test | Result | Tokens | Duration |
|---|---|---|---|---|
| 8.0 | Claim + Close with identity | PASS | 13,315 | 34s |
| 8.1 | Shell command execution | PASS | 14,453 | 37s |
| 8.2 | Comment instead of close | PASS | 15,439 | 36s |
Key observations:
- All three phases used the same session (
7bd1a29b-...) — OpenClaw maintains session continuity across agent invocations. - The agent correctly reads IDENTITY.md, SOUL.md, and the shared beads skill.
- The
QUESTION:prefix pattern (from SOUL.md) is used for structured communication. - Total cost:
43,000 tokens across 3 phases ($0.05 at Sonnet rates).