Skip to main content

SessionEvent

Enum SessionEvent 

Source
pub enum SessionEvent {
Show 31 variants RunStarted { run_id: String, goal: String, criteria: Vec<String>, agent_id: Option<String>, system_prompt: Option<String>, }, LlmCompleted { turn: u32, message: Message, provider_replay: Option<ProviderReplay>, }, ToolRequested { turn: u32, calls: Vec<ToolCall>, }, ToolCompleted { turn: u32, results: Vec<ToolResult>, }, Compressed { turn: u32, archived_seq_range: (u64, u64), category: Option<KernelEventCategory>, primitive: Option<Primitive>, action: Option<String>, summary: Option<String>, summary_tokens: Option<u32>, archive_ref: Option<String>, preserved_refs: Vec<String>, }, PageOut { turn: u32, category: Option<KernelEventCategory>, primitive: Option<Primitive>, action: Option<String>, summary: Option<String>, tier_hint: Option<String>, message_count: u32, }, PageIn { turn: u32, category: Option<KernelEventCategory>, primitive: Option<Primitive>, entry_count: u32, }, LargeResultSpooled { turn: u32, category: Option<KernelEventCategory>, primitive: Option<Primitive>, call_id: String, tool: String, original_size: u32, preview_size: u32, spool_ref: Option<String>, }, RunTerminal { reason: String, turns_used: u32, total_tokens: u64, }, ToolArgumentRepaired { turn: u32, tool: String, original_arguments: String, repaired_arguments: String, }, PermissionRequested { turn: u32, tool: String, arguments: String, reason: Option<String>, }, PermissionResolved { turn: u32, approved: bool, responder: String, }, ToolDenied { turn: u32, call_id: String, tool_name: String, reason: String, }, CapabilityChanged { turn: u32, category: Option<KernelEventCategory>, primitive: Option<Primitive>, added: Vec<String>, removed: Vec<String>, change_kind: Option<String>, capability_id: Option<String>, version: Option<String>, mounted_by: Option<String>, mount_reason: Option<String>, }, ContextRenewed { turn: u32, category: Option<KernelEventCategory>, primitive: Option<Primitive>, sprint: u32, handoff_ref: String, }, Suspended { turn: u32, category: Option<KernelEventCategory>, primitive: Option<Primitive>, reason: String, pending_calls: Vec<String>, }, Resumed { turn: u32, category: Option<KernelEventCategory>, primitive: Option<Primitive>, approved: Vec<String>, denied: Vec<String>, }, ToolGated { turn: u32, category: Option<KernelEventCategory>, primitive: Option<Primitive>, call_id: String, tool: String, reason: String, }, SignalDisposed { turn: u32, category: Option<KernelEventCategory>, primitive: Option<Primitive>, signal_id: String, disposition: String, queue_depth: u32, }, BudgetExceeded { turn: u32, category: Option<KernelEventCategory>, primitive: Option<Primitive>, budget: String, }, CheckpointTaken { turn: u32, category: Option<KernelEventCategory>, primitive: Option<Primitive>, history_len: u32, }, Rollbacked { turn: u32, category: Option<KernelEventCategory>, primitive: Option<Primitive>, checkpoint_history_len: u32, reason: Option<RollbackReason>, }, CleanupCompleted { run_id: String, freed_resources: Vec<String>, }, AgentProcessChanged { turn: u32, category: Option<KernelEventCategory>, primitive: Option<Primitive>, agent_id: String, parent_session_id: String, role: String, isolation: String, context_inheritance: String, state: String, permitted_capability_ids: Vec<String>, result_termination: Option<String>, }, MilestoneAdvanced { turn: u32, category: Option<KernelEventCategory>, primitive: Option<Primitive>, phase_id: String, capabilities_unlocked: Vec<String>, }, MilestoneBlocked { turn: u32, category: Option<KernelEventCategory>, primitive: Option<Primitive>, phase_id: String, reason: String, }, MilestoneEvidence { turn: u32, category: Option<KernelEventCategory>, primitive: Option<Primitive>, phase_id: String, evidence: Vec<String>, }, MemoryWritten { turn: u32, category: Option<KernelEventCategory>, primitive: Option<Primitive>, memory_id: String, memory_kind: String, size_bytes: u32, }, MemoryQueried { turn: u32, category: Option<KernelEventCategory>, primitive: Option<Primitive>, query_context: String, requested_k: usize, requires_async_response: bool, }, MemoryValidationFailed { turn: u32, category: Option<KernelEventCategory>, primitive: Option<Primitive>, memory_id: String, error: String, }, MemoryRetrievalResult { retrieval: MemoryRetrieval, },
}
Expand description

Append-only session event kinds for the unified Agent OS Runtime.

Combines execution loop events with OS-level lifecycle control, capability manifest auditing, and governance gates.

Variants§

§

RunStarted

Fields

§run_id: String
§goal: String
§criteria: Vec<String>
§agent_id: Option<String>
§system_prompt: Option<String>
§

LlmCompleted

Fields

§turn: u32
§message: Message
§provider_replay: Option<ProviderReplay>
§

ToolRequested

Fields

§turn: u32
§calls: Vec<ToolCall>
§

ToolCompleted

Fields

§turn: u32
§results: Vec<ToolResult>
§

Compressed

Fields

§turn: u32
§archived_seq_range: (u64, u64)
§primitive: Option<Primitive>
§action: Option<String>
§summary: Option<String>
§summary_tokens: Option<u32>
§archive_ref: Option<String>
§preserved_refs: Vec<String>
§

PageOut

Working memory paged out for long-term storage (kernel page_out).

Fields

§turn: u32
§primitive: Option<Primitive>
§action: Option<String>
§summary: Option<String>
§tier_hint: Option<String>
§message_count: u32
§

PageIn

Long-term entries injected into knowledge partition (SDK page_in).

Fields

§turn: u32
§primitive: Option<Primitive>
§entry_count: u32
§

LargeResultSpooled

Large tool result spooled to disk by the SDK (kernel Layer 1).

Fields

§turn: u32
§primitive: Option<Primitive>
§call_id: String
§tool: String
§original_size: u32
§preview_size: u32
§spool_ref: Option<String>
§

RunTerminal

Fields

§reason: String
§turns_used: u32
§total_tokens: u64
§

ToolArgumentRepaired

Tool arguments automatically repaired under white-listed heuristics.

Fields

§turn: u32
§tool: String
§original_arguments: String
§repaired_arguments: String
§

PermissionRequested

Escalated permission gate requested for a tool, suspending current execution.

Fields

§turn: u32
§tool: String
§arguments: String
§reason: Option<String>
§

PermissionResolved

Permission decision resolved by the user or an automated policy engine.

Fields

§turn: u32
§approved: bool
§responder: String
§

ToolDenied

Tool blocked monotonically by security governance policy or denial of consent.

Fields

§turn: u32
§call_id: String
§tool_name: String
§reason: String
§

CapabilityChanged

Model-visible capabilities dynamically updated (e.g., loading skills or mounting MCPs).

Fields

§turn: u32
§primitive: Option<Primitive>
§added: Vec<String>
§removed: Vec<String>
§change_kind: Option<String>
§capability_id: Option<String>
§version: Option<String>
§mounted_by: Option<String>
§mount_reason: Option<String>
§

ContextRenewed

Context reset and sprint rotated after a context boundary handoff.

Fields

§turn: u32
§primitive: Option<Primitive>
§sprint: u32
§handoff_ref: String
§

Suspended

Execution paused (waiting for human-in-the-loop interaction or long-running tasks).

Fields

§turn: u32
§primitive: Option<Primitive>
§reason: String
§pending_calls: Vec<String>
§

Resumed

Execution resumed.

Fields

§turn: u32
§primitive: Option<Primitive>
§approved: Vec<String>
§denied: Vec<String>
§

ToolGated

Kernel governance gate: tool requires approval before execution.

Fields

§turn: u32
§primitive: Option<Primitive>
§call_id: String
§tool: String
§reason: String
§

SignalDisposed

In-kernel signal disposition (attention policy).

Fields

§turn: u32
§primitive: Option<Primitive>
§signal_id: String
§disposition: String
§queue_depth: u32
§

BudgetExceeded

Scheduler budget axis exhausted.

Fields

§turn: u32
§primitive: Option<Primitive>
§budget: String
§

CheckpointTaken

Checkpoint taken at the start of a turn transaction (before LLM call).

Fields

§turn: u32
§primitive: Option<Primitive>
§history_len: u32
§

Rollbacked

Transaction rollback indicating state was restored to a checkpoint.

Fields

§turn: u32
§primitive: Option<Primitive>
§checkpoint_history_len: u32
§

CleanupCompleted

Host-level resources (temporary workspace trees, MCP child processes) garbage-collected.

Fields

§run_id: String
§freed_resources: Vec<String>
§

AgentProcessChanged

Kernel process table changed for a spawned sub-agent.

Fields

§turn: u32
§primitive: Option<Primitive>
§agent_id: String
§parent_session_id: String
§role: String
§isolation: String
§context_inheritance: String
§state: String
§permitted_capability_ids: Vec<String>
§result_termination: Option<String>
§

MilestoneAdvanced

Milestone phase criteria passed — capabilities unlocked, phase advanced.

Fields

§turn: u32
§primitive: Option<Primitive>
§phase_id: String
§capabilities_unlocked: Vec<String>
§

MilestoneBlocked

Milestone phase criteria not met — run continues without advancing the phase.

Fields

§turn: u32
§primitive: Option<Primitive>
§phase_id: String
§reason: String
§

MilestoneEvidence

Evidence collected by the verifier during milestone evaluation.

Fields

§turn: u32
§primitive: Option<Primitive>
§phase_id: String
§evidence: Vec<String>
§

MemoryWritten

Memory entry written successfully (SDK → kernel acknowledgment).

Fields

§turn: u32
§primitive: Option<Primitive>
§memory_id: String
§memory_kind: String
§size_bytes: u32
§

MemoryQueried

Memory query request (kernel → SDK; SDK should respond asynchronously).

Fields

§turn: u32
§primitive: Option<Primitive>
§query_context: String
§requested_k: usize
§requires_async_response: bool
§

MemoryValidationFailed

Memory validation failed (kernel rejected a write request).

Fields

§turn: u32
§primitive: Option<Primitive>
§memory_id: String
§error: String
§

MemoryRetrievalResult

Memory retrieval result (SDK → kernel via Resume or other async mechanism).

Fields

Implementations§

Source§

impl SessionEvent

Source

pub fn kind_str(&self) -> &'static str

Event kind string (snake_case tag).

Source

pub fn event_category(&self) -> KernelEventCategory

OS event category; uses embedded category when present, else infers from kind.

Source

pub fn is_kernel_os_event(&self) -> bool

Whether this event is a kernel OS decision (replay ignores for message reconstruction).

Trait Implementations§

Source§

impl Clone for SessionEvent

Source§

fn clone(&self) -> SessionEvent

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 SessionEvent

Source§

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

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

impl<'de> Deserialize<'de> for SessionEvent

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 Serialize for SessionEvent

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

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.