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) -> RunMeta
pub fn redacted(&self) -> RunMeta
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.
pub fn new( run_id: String, agent_name: String, agent_path: String, task: String, model: Option<String>, workdir: String, num_stages: usize, ) -> RunMeta
pub fn touch(&mut self)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RunMeta
impl<'de> Deserialize<'de> for RunMeta
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RunMeta, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RunMeta, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for RunMeta
impl Serialize for RunMeta
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for RunMeta
Auto Trait Implementations§
impl Freeze for RunMeta
impl RefUnwindSafe for RunMeta
impl Send for RunMeta
impl Sync for RunMeta
impl Unpin for RunMeta
impl UnsafeUnpin for RunMeta
impl UnwindSafe for RunMeta
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ConditionalSend for Twhere
T: Send,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more