Skip to main content

Module deliver

Module deliver 

Source
Expand description

agents queue deliver — wake every queue-pending descendant agent of the caller.

The handler enumerates the unique AIHs with active queued prompts that are STRICT descendants of the caller (the caller itself is excluded) and, per AIH, try-acquires the agent’s file lock with no waiting: a live owner yields AgentActiveResponseItem; winning the lock yields AgentSpawnedResponseItem and runs the same spawn machinery agents spawn / agents message use (empty messages + the stored continuation), 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 = true and emit the child’s items up to and including AllAgentsActive, 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§

request_schema
response_schema

Structs§

AgentActiveResponseItem
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.
AgentSpawnedResponseItem
This agent’s lock was won and its spawn has started; its output follows as ValueResponseItems (in stream_spawns mode).
Args
Command
Request
RequestDangerousAdvanced
ValueResponseItem
One output item from one delivered agent’s spawn stream. value is the typed root crate::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§

AgentActiveType
AgentSpawnedType
AllAgentsActive
Every target has resolved to active-or-spawned. Wire shape is the bare string "AllAgentsActive" (a one-variant enum — a unit variant in the untagged ResponseItem would serialize as null, not the marker string). The detached default mode stops reading its child at this item.
Path
ResponseItem
One stream item from agents queue deliver. Untagged — the variants are disjoint on the wire: Value requires value, AgentActive / AgentSpawned carry distinct type markers, and AllAgentsActive is the bare string "AllAgentsActive".
Schema

Functions§

execute
execute_jq