Expand description
Unified multi-agent delegation tool (agent) plus shared-memory tools.
§Design
A single agent tool replaces the previous fragmented delegation surface
(SubAgent / spawn_worker / spawn_workers_parallel / team_add_role /
team_remove_role / team_list_roles). The caller provides a manifest
that maps worker IDs to { system_prompt, allowed_tools } entries and an
execution mode:
"single"— one worker, exactly as ifSubAgent+ explicit role had been combined."parallel"— all workers run concurrently (join_all). Read-only workers benefit most."sequential"— workers run one after another, in manifest key order.
Shared-memory read/write are kept as independent tools so workers can coordinate through a shared key-value store.
§Recursive safety
A depth limit (RECURSIVE_SUBAGENT_MAX_DEPTH env, default 2) prevents
unbounded nesting. Each child agent increments the depth counter; when
the limit is reached the tool returns an error string instead of spawning.
Structs§
- Agent
Tool - The unified
agentdelegation tool. - Shared
Memory Read - The
shared_memory_readtool — read a value from the shared memory store. - Shared
Memory Write - The
shared_memory_writetool — write a value into the shared memory store. - Worker
Handle - A long-lived handle to a background worker, enabling cross-turn
continuation via
send_message.
Type Aliases§
- Worker
Table - A process-wide table of live background workers keyed by worker_id.
Shared between the
agenttool (which inserts) and thesend_messagetool ( which looks up to continue a worker).