Skip to main content

Module run

Module run 

Source
Expand description

agents tasks run — fire every pending schedule in the caller’s own subtree.

Scope is fixed: every schedule whose agent_instance_hierarchy is the caller’s own AIH or a descendant of it. Of those, the runner claims the pending ones (unfired oneshots + interval rows whose interval has elapsed — newest versions only), minting one tasks_runs row per firing, and dispatches each row’s stored argv through the root crate::run in parallel — with the schedule’s captured identity (and the plugin that registered it, if any) re-installed on the run ctx.

Two output modes, selected by dangerous_advanced.stream_all:

  • --dangerous-advanced '{"stream_all":true}': every item every task emits streams back, each wrapped as a ValueResponseItem.
  • default: exactly ONE SuccessResponseItem per task, emitted when that task’s stream completes — success is false iff the task’s final item was an error.

stream_all is gated behind dangerous_advanced (rather than a bare top-level flag) because streaming every item of every fired task can bloat the caller’s context astronomically.

The mode affects only the caller-visible stream: in BOTH modes the full per-item output is durably written to tasks_logs.

Re-exports§

pub use crate::cli::command::tasks::list::Plugin;

Modules§

request_schema
response_schema

Structs§

Args
Command
Request
RequestDangerousAdvanced
Advanced knobs gated behind --dangerous-advanced because they are easy to misuse. Modelled on agents spawn’s RequestDangerousAdvanced.
SuccessResponseItem
One per-task completion summary (default mode): the same schedule identity as ValueResponseItem, with success in lieu of value. success is false iff the task’s FINAL emitted item was an error (a task that emitted nothing is a success). The task’s full output is in tasks_logs regardless.
ValueResponseItem
One output item from one fired schedule’s in-process stream (stream_all mode). The first four fields identify the source schedule; value is the typed root crate::cli::command::ResponseItem emitted by the scheduled cli leaf — boxed because the root union transitively contains this type (agents → tasks → run), and boxing is what makes the recursion sized.

Enums§

Path
ResponseItem
One stream item from tasks run. Untagged — the variants’ required fields (value vs success) are disjoint, so the wire shape is just the inner object. Which variant flows is decided by the request’s stream_all: true streams every emitted item as a ValueResponseItem (whose value is the typed root item for a no-transform command, or the post-transform JSON otherwise — see RunValue); false (default) yields exactly one SuccessResponseItem per task when its stream completes.
RunValue
The per-item value a fired schedule emits, mirroring the two root dispatch paths at the item level (untagged — the wire shape is just the inner value):
Schema

Functions§

execute
execute_transform