#[non_exhaustive]pub struct TurnCompletedParams {
pub session_id: String,
pub view_cursor: String,
pub source_range: SourceRange,
pub turn_id: String,
pub terminal: TurnTerminal,
pub reason: Option<String>,
pub duration_ms: Option<u64>,
pub time_to_first_token_ms: Option<u64>,
pub usage: Option<TokenUsage>,
pub error: Option<TurnError>,
pub by_client: Option<ClientInfo>,
}Expand description
turn/completed params: the run’s durable terminal record landed.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.session_id: StringThe owning session.
view_cursor: StringOpaque, strictly monotonic view cursor.
source_range: SourceRangeThe durable records this event folded from.
turn_id: StringThe terminated turn.
terminal: TurnTerminalThe turn terminal (open enum).
reason: Option<String>The runtime’s free-text terminal reason, verbatim. Display and diagnostics only; never branch on it.
duration_ms: Option<u64>Turn duration; absent means unmeasured, never fabricated.
time_to_first_token_ms: Option<u64>Time to first token, when measured.
usage: Option<TokenUsage>The turn’s aggregate token usage, summed across the turn’s model
completions (same shape as session/tokenUsage.usage).
error: Option<TurnError>Present when terminal is "failed", except on a synthesized
host-death terminal, which carries reason instead: mid-turn failures
reach the client here — never as a JSON-RPC error.
by_client: Option<ClientInfo>The client whose wire stop was the first one accepted for this turn, when a wire stop ended it and its client was recorded. Absent otherwise, including on older logs.