pub struct TurnTrace {Show 18 fields
pub version: u32,
pub turn_id: String,
pub session_id: String,
pub started_at: u64,
pub ended_at: u64,
pub model_provider: String,
pub model_name: String,
pub task: String,
pub visible_tool_count: usize,
pub visible_tools: Vec<String>,
pub deferred_tools_discovered: Vec<String>,
pub tool_calls: Vec<ToolCallTrace>,
pub approvals: Vec<ApprovalTrace>,
pub capabilities: Vec<CapabilityLedgerEntry>,
pub verifier_results: Vec<VerifierTrace>,
pub metrics: TurnMetrics,
pub outcome: TurnOutcome,
pub final_message: String,
}Expand description
Structured trace for a single turn of agent execution.
Separates trace data from session events. Traces are focused on harness metrics, tool calls, verifiers, and outcomes — not full conversation history.
Fields§
§version: u32Schema version for forward compatibility.
turn_id: StringUnique turn identifier.
session_id: StringSession this turn belongs to.
started_at: u64Unix timestamp (milliseconds) when the turn started.
ended_at: u64Unix timestamp (milliseconds) when the turn ended.
model_provider: StringModel provider used.
model_name: StringModel name used.
task: StringThe user task or prompt that started this turn.
visible_tool_count: usizeHow many tool definitions were visible to the model.
visible_tools: Vec<String>Names of visible tools.
deferred_tools_discovered: Vec<String>Names of deferred tools discovered via tool.search.
tool_calls: Vec<ToolCallTrace>All tool calls made during this turn, in order.
approvals: Vec<ApprovalTrace>Approval decisions made during this turn.
capabilities: Vec<CapabilityLedgerEntry>Capability lifecycle entries recorded during this turn.
verifier_results: Vec<VerifierTrace>Verifier results from this turn.
metrics: TurnMetricsMetrics summary.
outcome: TurnOutcomeOutcome classification.
final_message: StringHuman-readable final message.
Implementations§
Source§impl TurnTrace
impl TurnTrace
Sourcepub const CURRENT_VERSION: u32 = 1
pub const CURRENT_VERSION: u32 = 1
Current trace schema version.
Sourcepub fn new(
turn_id: impl Into<String>,
session_id: impl Into<String>,
model_provider: impl Into<String>,
model_name: impl Into<String>,
task: impl Into<String>,
) -> Self
pub fn new( turn_id: impl Into<String>, session_id: impl Into<String>, model_provider: impl Into<String>, model_name: impl Into<String>, task: impl Into<String>, ) -> Self
Creates a new turn trace with the given basic fields.
Sourcepub fn record_tool_call(
&mut self,
invocation: &ToolInvocation,
result: &ToolResult,
duration_ms: u64,
)
pub fn record_tool_call( &mut self, invocation: &ToolInvocation, result: &ToolResult, duration_ms: u64, )
Records a tool call in the trace.
Sourcepub fn record_approval(
&mut self,
tool_name: &str,
risk: &str,
approved: bool,
duration_ms: u64,
)
pub fn record_approval( &mut self, tool_name: &str, risk: &str, approved: bool, duration_ms: u64, )
Records an approval decision.
Sourcepub fn record_capability(&mut self, entry: CapabilityLedgerEntry)
pub fn record_capability(&mut self, entry: CapabilityLedgerEntry)
Records a capability lifecycle entry.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TurnTrace
impl<'de> Deserialize<'de> for TurnTrace
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>,
Auto Trait Implementations§
impl Freeze for TurnTrace
impl RefUnwindSafe for TurnTrace
impl Send for TurnTrace
impl Sync for TurnTrace
impl Unpin for TurnTrace
impl UnsafeUnpin for TurnTrace
impl UnwindSafe for TurnTrace
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