pub struct RunMeta {Show 29 fields
pub run_id: String,
pub agent_name: String,
pub agent_path: String,
pub task: String,
pub model: Option<String>,
pub pid: u32,
pub status: RunStatus,
pub current_stage: String,
pub stage_index: usize,
pub num_stages: usize,
pub iteration: usize,
pub prompt_tokens: usize,
pub completion_tokens: usize,
pub cached_tokens: usize,
pub cache_write_tokens: usize,
pub tool_calls: usize,
pub workdir: String,
pub started_at: i64,
pub updated_at: i64,
pub error: Option<String>,
pub title: Option<String>,
pub metadata: HashMap<String, String>,
pub callback_url: Option<String>,
pub callback_secret: Option<String>,
pub parent_run_id: Option<String>,
pub children: Vec<String>,
pub depth: usize,
pub max_child_depth: usize,
pub flags: RunFlags,
}Expand description
Metadata for a single background agent run.
Fields§
§run_id: String§agent_name: String§agent_path: StringAbsolute path to the agent manifest directory
task: String§model: Option<String>§pid: u32PID of the worker process
status: RunStatus§current_stage: String§stage_index: usize§num_stages: usize§iteration: usize§prompt_tokens: usize§completion_tokens: usize§cached_tokens: usizeCumulative tokens read from provider cache.
cache_write_tokens: usizeCumulative tokens written to provider cache.
tool_calls: usizeTotal number of tool calls made across all iterations.
workdir: StringAbsolute path to the working directory for tool execution
started_at: i64Unix timestamp (seconds)
updated_at: i64Unix timestamp (seconds)
error: Option<String>§title: Option<String>Short human-readable title generated from the task prompt (None until generated).
metadata: HashMap<String, String>Custom key-value pairs from the spawn request (API metadata).
callback_url: Option<String>Webhook URL to POST on agent completion/error.
callback_secret: Option<String>Optional shared secret used to HMAC-SHA256 sign the webhook body
(X-Leviath-Signature header) so the receiver can verify authenticity.
Persisted, because the daemon must still be able to sign a webhook for a
run it reloaded after a restart. Never serve it - strip it with
RunMeta::redacted before any of this struct leaves the process. See
that method for what went wrong.
parent_run_id: Option<String>Links sub-agent runs to their parent run.
children: Vec<String>Run-ids of this agent’s direct sub-agents (sub-agent-tool spawns and fan-out workers). Persisted so the daemon can rebuild the exact parent→children tree on restart rather than reload children as orphans.
depth: usizeThis agent’s depth in the sub-agent tree (0 for a top-level run). Persisted so a reloaded child enforces its remaining spawn-depth budget.
max_child_depth: usizeThe sub-agent depth cap this agent imposes on its own children
(0 when it has none). Restores SubAgentChildren::max_child_depth.
flags: RunFlagsWhy this run may have produced nothing useful - see RunFlags.
Implementations§
Source§impl RunMeta
impl RunMeta
Sourcepub fn redacted(&self) -> Self
pub fn redacted(&self) -> Self
This run’s metadata with the webhook signing secret removed, for anything that leaves the process.
GET /api/agents, /api/agents/{id} and /api/agents/{id}/children all
serialized RunMeta whole, so any holder of the API token could read
every run’s callback_secret - the key that authenticates Leviath’s
webhooks to their receivers. Mirrors the RedactedConfig pattern the
/api/config handler already uses correctly.
Returns an owned copy rather than mutating in place so a caller cannot accidentally redact the record the daemon still needs for signing.