How does one agent delegate to another, and can it still control that work? Our design: Agent collaboration; our tool surface: architecture.
How this was checked
Seven repositories were read directly, with file paths and line numbers. Claude Code findings come only from its public documentation; a mechanism it does not describe reads “Undocumented”. For the other systems, an empty or “none” entry means the mechanism is absent, not unchecked.
Overview
System
Spawning
Direct messages
Tracking
Cascading cancel
Ours
In-process; depth optional
Any to any
execution_id, two tools
Yes
Claude Code
Within the session, depth 3
Yes, across machines
agentId, ListAgents, TaskStop
Undocumented
codex-cli
In-process; V1 depth 1, V2 unlimited
Yes, siblings
ThreadId, four tools
Partial
openclaw
In-process or external, depth 1
Yes, if enabled
runId, list only
Yes
opencode
In-process, implicit depth 1
No
Child session id
Yes
hermes-agent
In-process pool, depth 1
Not in the tree; through the board
None for the model
Yes
pi-mono
Child process, unlimited
No
None
One level
pi-ai
None
None
None
Not applicable
weclaw
None
No
None
Not applicable
System
Loop controls
Tool restriction
Addressing
Lines
Ours
4 on, 3 optional
Remove by remaining allowance
Branch name or SID:HEAD
9.3k
Claude Code
7
Withheld at the depth limit; a fork gets an error at call
Name or agent ID
Undocumented
codex-cli
2
Remove; V1 also rejects
Path, /root/x
7k
openclaw
8
Remove, recheck at spawn
Session key
17k
opencode
3
Remove or reject, by rule shape
Agent type name
0.4k
hermes-agent
5
Remove whole toolsets
Anonymous, one-shot
2.9k
pi-mono
2
Remove by allowlist
Name of an on-disk .md
1.3k
pi-ai
None
Not applicable
None
0
weclaw
1
Not applicable
@name
1.1k
Spawning children
System
Runs as
Depth limit and where it is enforced
Ours: agent
In-process pool, 8 workers by default; 6 running per conversation, the rest queued
agent.max_spawn_depth, 1 by default; past it, “do the work yourself”. agent.max_spawn_fanout per turn, off by default.
Claude Code: Agent, formerly Task
Subagents in the session, optionally isolation: worktree; teammates in-process or in tmux or iTerm2 panes
Depth 3 by default, set by CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH; concurrency 20 by default, set by CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS.
codex-cli: spawn_agent
Tokio tasks on one thread manager
V1 depth 1. V2 computes child depth and never checks it; disabled by default; only concurrency caps it.
openclaw: sessions_spawn
subagent in-process; acp external host process, off in sandboxes
Depth 1, up to 5, counted from :subagent: segments of the session key
opencode: task
Re-enters the prompt loop in a child session
No number. A task: * deny rule removes the tool from the child, giving depth 1; an agent declaring permission.task=allow is unlimited.
hermes-agent: delegate_task
Thread pool; external ACP CLI; one process per board card
MAX_DEPTH=1, clamped to 1–3
pi-mono: example extension; core omits it
One new pi --mode json -p --no-session per child
None. Children reload the extension, and worker declares no allowlist, so recursion is unbounded.
pi-ai
Read-only snapshot of pi-mono's LLM transport; neither compiled nor imported
Not applicable
weclaw
Starts user-configured agent CLIs as top-level agents
No nesting
Subprocess paths give isolation, not depth control.
Code locations
System
Location
Ours
programs/tools/agents/agent/agent/agent.py; defaults in state/settings.py
send_message(to=) from any agent to any unarchived branch, same path across sessions, no ownership check. Busy targets queue in the session inbox.
Claude Code
SendMessage. to: teammate or subagent name, main, an agent ID, or another session’s name; a local session’s inbox address starts with uds:. No broadcast: one message per recipient. Teammates use file mailboxes ~/.claude/teams/{team}/inboxes/{name}.json. Sending to a finished subagent resumes it.
codex-cli
send_message, followup_task, straight to the target thread. Absolute paths let siblings address each other. Delivery queues, or wakes the recipient for one turn.
openclaw
sessions_send, off by default: a config switch and pairwise allowlist. A bounded back-and-forth loop. Children cannot use it and return through the parent's announcement queue.
opencode
Parent to child only, which may append to a running child. No messaging tool in the registry.
hermes-agent
Children report to parents only; send_message is on the never-for-children list. Board workers, one process per card, exchange card comments in a shared database; the root card holds a conventional shared area.
pi-mono
One prompt at spawn, stdout on exit. Sequential mode substitutes the previous output into the next task, the only sibling channel.
pi-ai
No agents
weclaw
@a @b message sends one message to several agents, each replying to the human with a prefix. Agents cannot see each other.
Beyond one process: Claude Code reaches other local sessions and machines, ours any session, openclaw by session key.
On: 4 concurrent, inbox 50 with oldest evicted, 60 s duplicate window, self-delivery rejected. Optional, off by default: depth, per-chain messages, per-turn fan-out. No tool-round cap on chat turns.
Claude Code
Depth 3 and concurrency 20 by default, no total spawn cap; a fork cannot fork; teammates cannot spawn teammates. Cross-session messages: rate-limited per sender, identical repeats dropped within a short window, at most 50 queued.
codex-cli
Depth (V1 1, V2 none); concurrency 6 global, 4 per V2 session. No dedup, count, rate limit or cycle detection, so with sibling addressing nothing stops two agents delegating forever.
openclaw
Depth 1 (to 5); 5 children per agent (to 20); concurrency 8 and 4; conversations 5 rounds (to 20); 2 s steering limit; 3 announcement retries; child-key dedup; tool-loop detector, off by default.
opencode
Depth by injected permission. Same tool with identical arguments 3 times prompts for permission. Steps unlimited by default.
hermes-agent
Depth 1 (to 3); 3 concurrent; 50 iterations per child; 600 s timeout plus heartbeat; a global spawn pause; delegation toolset removed from leaves. No dedup or count.
pi-mono
Fan-out 8, concurrency 4, 50KB output per task. No depth, dedup, rate or round cap; recursion is unbounded.
pi-ai
No tool loop
weclaw
Dedup: WeChat ids for 5 minutes, names within a broadcast. No return channel, so no cycles.
Depth limits are nearly universal; only three systems count messages.
examples/extensions/subagent/index.ts:27-30; main loop packages/agent/src/agent-loop.ts:170
weclaw
messaging/handler.go:273,63-64; name deduplication :246-253
Restricting child tools
A: remove from the list
The model never sees it. Definitions differ by level, so prompt caches split.
B: keep, reject at call
Definitions stay byte-identical and caches hit. An attempted call wastes a turn.
System
Approach
What and when
Ours
A by remaining allowance, then refusal
Only agent, only when the message budget is out (delegation_budget_left), since every dispatch costs a message. Spent generations do not remove it: work can still go to existing agents. Everything else stays. Deliberately binary: a per-level set would shred the prompt cache.
Claude Code
A and B
Agent is withheld at the depth limit; a fork keeps it and gets an error at call.
codex-cli
V1 A+B, V2 A
Tool list omits collaboration tools at the limit; V1 handlers also reject. Roles overlay configuration files, not allowlists.
openclaw
A+B
All children lose gateway, agent listing, session status, scheduled tasks and cross-agent messaging. Leaves also lose subagent listing, session listing, history and spawning. Spawn rechecks depth.
opencode
A or B
Deny with "*" removes from the schema; a specific pattern keeps it and throws at call, returning the matched rule.
hermes-agent
A, per toolset
Requested ∩ parent-owned, minus delegation, user-question, memory and code execution. Gap: the never-for-children list only generates docs, so a child inheriting the messaging set still gets send_message.
pi-mono
A
Allowlist becomes child arguments; the child filters its registry and rebuilds its prompt.
pi-ai
Not applicable
No tool executor
weclaw
Not applicable
Tools are opaque inside the wrapped CLI
Code locations
System
Location
Ours
programs/tools/agents/send_message/send_message/depth.py delegation_budget_left; can_use on programs/tools/agents/agent/agent/agent.py
73 non-test TypeScript files, including UI commands and registries
Ours, about 9,300
Agent tools 2,526; jobs package without resource governance 5,541; inbox 511; sub_agent_run 750
codex-cli, 7,059
Multi-agent core; plus 3,676 supporting and 13,114 test lines
hermes-agent, 2,900
Delegation; plus about 1,600 for the Kanban path
pi-mono, 1,310
Whole example extension; the mechanism is about 190
weclaw, 1,050
All agent code; routing core about 150
opencode, 415
Delegation; plus about 365 of reused background-task code
pi-ai, 0
No implementation
Boundaries differ; compare orders of magnitude only. Tests excluded.
What we took from this
Domain
Tools
Holds
Plan
task_start, task_step, task_list
A named task and its steps; editing runs nothing
Execution
read_conversation, close_agent
One id, one status, guaranteed return, cascading cancel
Entity
agent, list_agents, send_message
An agent is a branch in the session graph
Communication
send_message, read_conversation
Messages without task records; any branch's transcript
Choice
Against
Why
Tool names agent, list_agents, send_message
Claude Code
Models already know them
Planning is todo_*
Differs from Claude Code
Its TaskList is a plan board; ours keeps running work and plans apart
Address a branch, not a process
Like codex-cli paths, openclaw keys
(session, head) identifies it without an agent table
Any agent may message any agent
Looser than openclaw; like codex-cli V2, Claude Code
A message makes no task and cannot cascade; the worst outcome is silence
One message tool: send_message always makes a Job
Codex send_input, Claude Code SendMessage
Return, cancel and cascade belong to Jobs; one tool removes the choice between three addressing forms
Per-chain message budget; 8 when set, counting return flow
Only openclaw also counts
Depth alone cannot stop existing agents delegating to each other. 8 sits between openclaw's 5 and 20 because we also charge spawns and dispatches. A return rebinds the count, so one round trip costs 1; generations restore to the dispatcher's, so a coordinator can dispatch the next batch.
Depth 1 when set, not 3
openclaw, codex-cli V1, hermes, opencode
Depth 3 suits nesting with a human watching. Our unattended path is run_in_background=True.
Per-turn fan-out; 8 when set
Only openclaw has a true fan-out cap
A spawn leaves the parent's counters alone, so neither chain counter sees siblings. openclaw's 5 live children (1–20) is the reusable unit; hermes's 3 and pi-mono's 8 are batch arguments and agent makes one child. 8 is two pool widths: fill it, queue a batch, then refuse the ninth and name the existing eight.
No steering rate limit or child hard timeout
openclaw 2 s; hermes 600 s
openclaw's limit guards steer, which aborts the child's turn; ours queues and interrupts nothing. Hermes's timeout is a caller-side wait that abandons the thread. job_output(timeout=) is that wait, and execution.cancel also terminates the runtime and forces a terminal state after 30 s.
Remove tools by allowance, binary
Others remove always or by depth tier
Tiers invalidate prompt caches
Extra tools close_agent, read_conversation
Codex close_agent; Claude Code TaskStop
Stop and retire a helper in one call, read history without raw session files
Rationale for each number sits beside its constant. Limits ship off, so the job pool bounds concurrency and the owner chooses depth. Open gaps: implementation status.