Expand description
agents queue deliver — wake every queue-pending descendant
agent of the caller.
The handler enumerates two kinds of targets with active queued
prompts in the caller’s subtree: unique AIHs that are STRICT
descendants of the caller (direct rows + rows against BOUND
tags), and un-upgraded (GROUPED) tags whose group parent sits in
the subtree. Per target it try-acquires the agent’s (or tag’s)
lock with no waiting: a live owner yields
AgentActiveResponseItem / TagActiveResponseItem; winning
the lock yields AgentSpawnedResponseItem /
TagSpawnedResponseItem and runs the same spawn machinery
agents spawn / agents message use (empty messages, plus the
stored continuation for AIHs or the group’s stored agent spec for
tags), streaming each spawn item as a ValueResponseItem and
releasing the lock when that task’s stream ends. Once EVERY
target has resolved (active or spawned), the bare string
"AllAgentsActive" is emitted.
Two modes, selected by dangerous_advanced.stream_spawns:
- unset/false (the default, user-facing): re-exec the cli binary
as a detached orphan with
stream_spawns = trueand emit the child’s items up to and includingAllAgentsActive, then return — the orphan keeps running the spawns to completion. - true (the re-exec’d child): run the full delivery in-process and stream everything, spawn output included.
Modules§
Structs§
- Agent
Active Response Item - This agent’s lock was held by a live owner — it is already active and will drain its own queue; nothing was spawned for it.
- Agent
Spawned Response Item - This agent’s lock was won and its spawn has started; its output
follows as
ValueResponseItems (instream_spawnsmode). - Args
- Command
- Request
- Request
Dangerous Advanced - TagActive
Response Item - This un-upgraded tag’s lock was held by a live owner — another process is already materializing it; the queued rows will reach the agent it mints. Nothing was spawned for it.
- TagSpawned
Response Item - This un-upgraded tag’s lock was won and a fresh spawn of the
group’s stored agent spec has started. The minted
agent_instance_hierarchyisn’t known yet at this point — it arrives as the FIRST inner item (the spawnId) of theValueResponseItems that follow (instream_spawnsmode). - Value
Response Item - One output item from one delivered agent’s spawn stream.
valueis the typed rootcrate::cli::command::ResponseItem(the spawn item wrapped at the root) — boxed because the root union transitively contains this type (agents → queue → deliver), and boxing is what makes the recursion sized.
Enums§
- Agent
Active Type - Agent
Spawned Type - AllAgents
Active - Every target has resolved to active-or-spawned. Wire shape is the
bare string
"AllAgentsActive"(a one-variant enum — a unit variant in the untaggedResponseItemwould serialize asnull, not the marker string). The detached default mode stops reading its child at this item. - Path
- Response
Item - One stream item from
agents queue deliver. Untagged — the variants are disjoint on the wire:Valuerequiresvalue,AgentActive/AgentSpawned/TagActive/TagSpawnedcarry distincttypemarkers, andAllAgentsActiveis the bare string"AllAgentsActive". - Schema
- TagActive
Type - TagSpawned
Type