pub enum SessionEvent {
SessionStarted {
session_id: String,
cwd: String,
provider_name: String,
model: String,
forked_from: Option<(String, u64)>,
},
UserMessage {
text: String,
image_refs: Vec<String>,
},
AssistantMessage {
parts: Vec<MessagePart>,
},
ToolCall {
id: String,
name: String,
input: Value,
},
ToolResult {
id: String,
name: String,
output: String,
is_error: bool,
duration_ms: u64,
},
Condensation {
replaced_seq_range: (u64, u64),
summary: AnchoredSummary,
tokens_before: u32,
tokens_after: u32,
},
Compaction {
tier: CompactionTier,
cleared_count: u32,
summary: Option<AnchoredSummary>,
},
ForkPoint {
new_session_id: String,
},
ModelChanged {
provider_name: String,
model: String,
},
SessionEnded {
reason: String,
},
}Expand description
The kind of a persisted conversation-session event.
See specs/068-session-persistence/spec.md §4.3 for the full contract. MessagePart is
reused from zeph_llm::provider and AnchoredSummary from zeph_common::memory — this
enum MUST NOT redefine either.
Variants§
SessionStarted
First event of a session’s log; also written as the header line of a forked child log.
Fields
UserMessage
A user turn.
AssistantMessage
An assistant turn.
Fields
parts: Vec<MessagePart>ToolCall
A model-initiated tool invocation.
ToolResult
The result of a SessionEvent::ToolCall. Replay never re-executes tools; it folds this
recorded output.
Condensation
Durable, replayable condensation of a seq range (distinct from live in-memory
compaction; see spec §8.1).
Fields
summary: AnchoredSummaryCompaction
Recorded when live hard-compaction fires during a turn, so replay can fold the same prune/summary deterministically.
ForkPoint
Non-destructive provenance record appended to the parent log when a child session is forked from it.
ModelChanged
The active provider/model changed mid-session.
SessionEnded
The session ended; reason is one of user_quit | idle_ttl | shutdown | error.
Trait Implementations§
Source§impl Clone for SessionEvent
impl Clone for SessionEvent
Source§fn clone(&self) -> SessionEvent
fn clone(&self) -> SessionEvent
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 SessionEvent
impl Debug for SessionEvent
Source§impl<'de> Deserialize<'de> for SessionEvent
impl<'de> Deserialize<'de> for SessionEvent
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 SessionEvent
impl RefUnwindSafe for SessionEvent
impl Send for SessionEvent
impl Sync for SessionEvent
impl Unpin for SessionEvent
impl UnsafeUnpin for SessionEvent
impl UnwindSafe for SessionEvent
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
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