M10: Two-Agent Handoff — Eng-Mgr Delegates to Dev
2026-02-21 by Showboat manual capture
M10 demonstrates multi-agent coordination: eng-mgr receives a high-level task, breaks it into dev-labeled sub-beads using --parent, and the dev agent claims and executes each one. The eng-mgr is re-invoked to check status and close the parent when all children are done.
Prerequisites
Both agents deployed on Mimas, sessions cleared, test-greeter on main.
ssh openclaw@mimas "ls /home/openclaw/b4arena/repos/test-greeter/"
greetings.conf
greet.sh
README.md
test.sh
ssh openclaw@mimas "cd /home/openclaw/b4arena/repos/test-greeter && git branch --show-current && bash test.sh"
main
Tests: 2 passed, 0 failed
Act 1: Eng-Mgr Triage
Create a high-level bead labeled eng-mgr:
ssh openclaw@mimas 'BEADS_DIR=/home/openclaw/b4arena/beads/.beads BD_ACTOR=demo bd create "Add --formal flag to test-greeter" --labels eng-mgr -d "The greeter should support a --formal flag that uses formal greeting templates. Requires changes to greet.sh and greetings.conf, plus test coverage. Repo: test-greeter." --json 2>/dev/null'
{
"id": "beads-fdg",
"title": "Add --formal flag to test-greeter",
"status": "open",
"priority": 2,
"created_by": "demo"
}
Trigger eng-mgr via watcher+dispatcher:
ssh openclaw@mimas "export BEADS_DIR=/home/openclaw/b4arena/beads/.beads && cd /home/openclaw/b4arena && bash scripts/beads-watcher.sh 2>/dev/null | bash scripts/agent-openclaw.sh --label eng-mgr --timeout 300 2>&1" 2>/dev/null | grep -E "^(Processing|OK:)"
Processing bead beads-fdg via agent b4-eng-mgr (actor: eng-mgr-agent)...
OK: bead beads-fdg processed by b4-eng-mgr
Verify: parent claimed (in_progress), sub-bead created with --parent:
ssh openclaw@mimas 'BEADS_DIR=/home/openclaw/b4arena/beads/.beads bd show beads-fdg --json 2>/dev/null' | python3 -c "import json,sys; d=json.load(sys.stdin)[0]; print(json.dumps({k:d[k] for k in ['id','status','assignee','title']}, indent=2))"
{
"id": "beads-fdg",
"status": "in_progress",
"assignee": "eng-mgr-agent",
"title": "Add --formal flag to test-greeter"
}
ssh openclaw@mimas 'BEADS_DIR=/home/openclaw/b4arena/beads/.beads bd list --parent beads-fdg --json 2>/dev/null' | python3 -c "import json,sys; beads=json.load(sys.stdin); [print(json.dumps({k:b.get(k) for k in ['id','title','status','labels']}, indent=2)) for b in beads]"
{
"id": "beads-fdg.1",
"title": "Add --formal flag to greet.sh with formal greeting templates and tests",
"status": "open",
"labels": ["dev"]
}
PASS. Eng-mgr claimed the parent, created 1 sub-bead with --parent beads-fdg and label dev, left the parent open (in_progress). The agent correctly assessed that one PR covers the full scope.
Act 2: Dev Executes
Clear dev session and trigger:
ssh openclaw@mimas "export BEADS_DIR=/home/openclaw/b4arena/beads/.beads && cd /home/openclaw/b4arena && bash scripts/beads-watcher.sh 2>/dev/null | bash scripts/agent-openclaw.sh --label dev --timeout 300 2>&1" 2>/dev/null | grep -E "^(Processing|OK:)"
Processing bead beads-fdg.1 via agent b4-dev (actor: dev-agent)...
OK: bead beads-fdg.1 processed by b4-dev
Verify: sub-bead closed with PR link, PR exists on GitHub:
ssh openclaw@mimas 'BEADS_DIR=/home/openclaw/b4arena/beads/.beads bd show beads-fdg.1 --json 2>/dev/null' | python3 -c "import json,sys; d=json.load(sys.stdin)[0]; print(json.dumps({k:d[k] for k in ['id','status','assignee','close_reason']}, indent=2))"
{
"id": "beads-fdg.1",
"status": "closed",
"assignee": "dev-agent",
"close_reason": "Implemented --formal flag in PR https://github.com/b4arena/test-greeter/pull/1. Changes: greet.sh parses --formal before NAME and selects formal-greetings.conf when set; formal-greetings.conf added with 5 templates; test.sh extended with 5 new tests covering formal output, unchanged casual path, and space-containing names. All 7 tests pass."
}
ssh openclaw@mimas "gh pr view 1 --repo b4arena/test-greeter --json title,url,state"
{"state":"OPEN","title":"Feat: Add --formal flag to greet.sh (beads-fdg.1)","url":"https://github.com/b4arena/test-greeter/pull/1"}
ssh openclaw@mimas "cd /home/openclaw/b4arena/repos/test-greeter && git checkout feat/beads-fdg.1-formal-flag 2>/dev/null && bash test.sh"
Tests: 7 passed, 0 failed
ssh openclaw@mimas "cd /home/openclaw/b4arena/repos/test-greeter && bash greet.sh --formal Alice && bash greet.sh Bob"
Good day to you, Alice.
Hello, Bob!
PASS. Dev agent claimed the sub-bead, implemented the --formal flag across 3 files, created branch feat/beads-fdg.1-formal-flag, pushed, created PR #1, and closed the bead with PR URL. All 7 tests pass. Formal and casual greetings work correctly.
Act 3: Eng-Mgr Status Check (Re-invocation)
The parent bead is in_progress — the watcher won't emit it. Manual trigger:
ssh openclaw@mimas "/opt/openclaw/bin/openclaw agent --agent b4-eng-mgr --message 'Check status of bead beads-fdg. Use BEADS_DIR=/home/openclaw/b4arena/beads/.beads and BD_ACTOR=eng-mgr-agent. Query children with bd list --parent beads-fdg --json. If all children are closed, close the parent with a summary of their close_reasons (PR links).' --json --timeout 120 2>&1" 2>/dev/null | python3 -c "import json,sys; d=json.load(sys.stdin); [print(p['text'][-200:]) for p in d['payloads'][-1:]]"
Parent bead is now closed with the PR link and full close summary.
Verify final state:
ssh openclaw@mimas 'BEADS_DIR=/home/openclaw/b4arena/beads/.beads bd show beads-fdg --json 2>/dev/null' | python3 -c "import json,sys; d=json.load(sys.stdin)[0]; print(json.dumps({k:d[k] for k in ['id','status','assignee','close_reason']}, indent=2))"
{
"id": "beads-fdg",
"status": "closed",
"assignee": "eng-mgr-agent",
"close_reason": "All sub-tasks complete. beads-fdg.1: Implemented --formal flag in PR https://github.com/b4arena/test-greeter/pull/1 — greet.sh parses --formal and selects formal-greetings.conf; formal-greetings.conf added with 5 templates; test.sh extended with 5 new tests (all 7 pass)."
}
PASS. Eng-mgr queried children, found all closed, and closed the parent with a summary including the PR link.
Summary
| Act | Agent | Action | Result |
|---|---|---|---|
| 1 | eng-mgr | Triage: claim parent, create sub-bead with --parent | PASS |
| 2 | dev | Execute: implement, test, PR, close sub-bead | PASS |
| 3 | eng-mgr | Status check: query children, close parent | PASS |
Token Usage
| Act | Agent | Input (cache) | Output | Duration |
|---|---|---|---|---|
| 1 | b4-eng-mgr | 105K (cached) | 2,312 | 72s |
| 2 | b4-dev | 181K (cached) | 3,293 | 83s |
| 3 | b4-eng-mgr | 51K (cached) | 684 | 43s |
Key Observations
--parentflag works end-to-end —bd create --parentcreates hierarchical IDs (beads-fdg.1),bd list --parentqueries children. No comment-parsing needed.- Eng-mgr correctly assessed scope — created 1 sub-task instead of 3, recognizing the feature fits in a single PR. Good agent judgment.
- Parent stays open during execution — the new SOUL.md workflow keeps the parent
in_progressuntil all children are done. No premature close. - Re-invocation via manual trigger works —
openclaw agent --message "Check status..."is sufficient for M10. Automation deferred to M11. - Session reset between acts prevents bleed-through — each agent starts fresh, avoiding the M9 lesson of accumulated workarounds.
sudo -u openclaw openclaw agentfails — env vars (TELEGRAM_BOT_TOKEN etc.) not loaded. Usessh openclaw@mimasinstead.