Skip to main content

SessionRecord

Enum SessionRecord 

Source
pub enum SessionRecord {
Show 16 variants SessionCreated { profile_id: ProfileId, metadata: ProtocolMetadata, }, MessageCommitted { message: CanonicalMessage, }, ConfigurationChanged { model: Option<ModelRef>, profile_id: Option<ProfileId>, reasoning_effort: Option<ReasoningEffort>, }, ToolCallRequested { tool_call_id: ToolCallId, tool_name: String, arguments: Value, }, PolicyDecisionRecorded { tool_call_id: ToolCallId, decision: PolicyDecision, }, ApprovalRequested { approval_id: ApprovalId, tool_call_id: ToolCallId, expires_at: ProtocolTimestamp, }, ApprovalResolved { approval_id: ApprovalId, decision: ApprovalDecision, }, ToolExecutionStarted { tool_call_id: ToolCallId, execution_target: ExecutionTarget, idempotency: ToolIdempotency, }, ToolExecutionFinished { tool_call_id: ToolCallId, is_error: bool, content: Vec<ContentBlock>, error: Option<ToolFailure>, presentation: Option<ToolPresentation>, }, ToolExecutionInterrupted { tool_call_id: ToolCallId, reason: String, }, RunInterrupted { run_id: RunId, turn_id: TurnId, reason: String, }, RunCancelled { run_id: RunId, }, BranchCreated { source_branch_id: BranchId, branch_id: BranchId, from_record_id: RecordId, }, ActiveBranchChanged { branch_id: BranchId, }, SessionCompacted { summary: CanonicalMessage, compacted_through_record_id: RecordId, }, TurnCheckpointed { run_id: RunId, turn_id: TurnId, next_action: NextTurnAction, },
}
Expand description

A typed durable fact used for deterministic session replay.

Variants§

§

SessionCreated

A session was created with its initial profile and extension metadata.

Fields

§profile_id: ProfileId

Initial product profile.

§metadata: ProtocolMetadata

Bounded session metadata.

§

MessageCommitted

A canonical message was committed.

Fields

§message: CanonicalMessage

Durable canonical message.

§

ConfigurationChanged

Model or profile configuration changed.

Fields

§model: Option<ModelRef>

New provider-qualified model when changed.

§profile_id: Option<ProfileId>

New profile when changed.

§reasoning_effort: Option<ReasoningEffort>

New provider-neutral reasoning effort when changed.

§

ToolCallRequested

A complete tool call became durable before policy/execution.

Fields

§tool_call_id: ToolCallId

Canonical tool-call identifier.

§tool_name: String

Registered tool name.

§arguments: Value

Provider-neutral JSON object arguments.

§

PolicyDecisionRecorded

Policy produced a durable decision for a tool call.

Fields

§tool_call_id: ToolCallId

Tool call evaluated by policy.

§decision: PolicyDecision

Stable policy outcome.

§

ApprovalRequested

Interactive approval became pending.

Fields

§approval_id: ApprovalId

Approval request identifier.

§tool_call_id: ToolCallId

Tool call awaiting approval.

§expires_at: ProtocolTimestamp

Approval expiry.

§

ApprovalResolved

Interactive approval reached a terminal decision.

Fields

§approval_id: ApprovalId

Approval request identifier.

§decision: ApprovalDecision

Stable approval decision.

§

ToolExecutionStarted

Tool execution started before crossing an uncertain external boundary.

Fields

§tool_call_id: ToolCallId

Tool call being executed.

§execution_target: ExecutionTarget

Executor boundary.

§idempotency: ToolIdempotency

Declared recovery/retry semantics.

§

ToolExecutionFinished

Tool execution reached a durable terminal result.

Fields

§tool_call_id: ToolCallId

Tool call that reached a terminal result.

§is_error: bool

Whether the result is a failure.

§content: Vec<ContentBlock>

Canonical display/model result content.

§error: Option<ToolFailure>

Machine-readable failure, required exactly when is_error is true.

§presentation: Option<ToolPresentation>

Optional bounded UI-only presentation retained out of model context.

§

ToolExecutionInterrupted

Started tool execution was interrupted and its outcome is uncertain.

Fields

§tool_call_id: ToolCallId

Tool call with uncertain outcome.

§reason: String

English technical recovery diagnostic.

§

RunInterrupted

Provider streaming stopped before a terminal message was durable.

Fields

§run_id: RunId

Interrupted run.

§turn_id: TurnId

Active turn when interruption occurred.

§reason: String

English technical recovery diagnostic.

§

RunCancelled

An active run was explicitly cancelled.

Fields

§run_id: RunId

Cancelled run.

§

BranchCreated

A new branch was created without rewriting parent history.

Fields

§source_branch_id: BranchId

Source branch.

§branch_id: BranchId

New branch.

§from_record_id: RecordId

Source record position.

§

ActiveBranchChanged

Active branch leaf changed durably.

Fields

§branch_id: BranchId

New active branch.

§

SessionCompacted

A compaction summary was committed with source provenance.

Fields

§summary: CanonicalMessage

Summary message.

§compacted_through_record_id: RecordId

Last source record replaced in model context.

§

TurnCheckpointed

A turn reached a durable checkpoint before its next action.

Fields

§run_id: RunId

Current run.

§turn_id: TurnId

Current turn.

§next_action: NextTurnAction

Action allowed after this durable boundary.

Implementations§

Source§

impl SessionRecord

Source

pub const fn record_type(&self) -> SessionRecordType

Returns the stable durable record discriminator.

Trait Implementations§

Source§

impl Clone for SessionRecord

Source§

fn clone(&self) -> SessionRecord

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SessionRecord

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SessionRecord

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for SessionRecord

Source§

fn eq(&self, other: &SessionRecord) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for SessionRecord

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for SessionRecord

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.