pub struct WorkerStats {
pub worker_kind: Option<String>,
pub model: Option<String>,
pub usage: Option<TokenUsage>,
pub num_turns: Option<u32>,
pub adapter_data: Option<Value>,
}Expand description
Normalized per-attempt worker statistics, reported by a worker
boundary (spawner fold site / result captor / POST /v1/worker/submit) into the engine and folded into the terminal
crate::store::run::StepEntry by the dispatcher.
The three named fields are the closed schema the engine knows;
everything worker-kind-specific rides in Self::adapter_data as
raw JSON the engine never interprets (capped at
TRACE_PAYLOAD_CAP_BYTES on fold). Every field is optional —
absence must never block a dispatch.
Fields§
§worker_kind: Option<String>Worker kind label ("agent_block" / "subprocess" /
"operator" / …) — set by whichever boundary constructed the
stats, since only that boundary knows its own kind.
model: Option<String>The model that served the attempt, when the boundary knows it
(subprocess: the rendered {model} placeholder; operator:
self-report; agent-block: spec-declared model if any).
usage: Option<TokenUsage>Normalized token usage, when the boundary can produce one.
num_turns: Option<u32>Number of LLM turns the attempt ran (agent-block num_turns).
adapter_data: Option<Value>Worker-kind-specific raw payload (exit code, stderr tail, cache token detail, …). Observational only — the engine stores it verbatim (size-capped) and never branches on it.
Implementations§
Trait Implementations§
Source§impl Clone for WorkerStats
impl Clone for WorkerStats
Source§fn clone(&self) -> WorkerStats
fn clone(&self) -> WorkerStats
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WorkerStats
impl Debug for WorkerStats
Source§impl Default for WorkerStats
impl Default for WorkerStats
Source§fn default() -> WorkerStats
fn default() -> WorkerStats
Source§impl<'de> Deserialize<'de> for WorkerStats
impl<'de> Deserialize<'de> for WorkerStats
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for WorkerStats
impl JsonSchema for WorkerStats
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for WorkerStats
impl PartialEq for WorkerStats
Source§impl Serialize for WorkerStats
impl Serialize for WorkerStats
impl StructuralPartialEq for WorkerStats
Auto Trait Implementations§
impl Freeze for WorkerStats
impl RefUnwindSafe for WorkerStats
impl Send for WorkerStats
impl Sync for WorkerStats
impl Unpin for WorkerStats
impl UnsafeUnpin for WorkerStats
impl UnwindSafe for WorkerStats
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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