pub struct SessionResumeInfo {
pub is_resume: bool,
pub prior_message_count: usize,
pub prior_turn_count: usize,
pub last_active: Option<String>,
}Expand description
Presentation-only summary of a conversation-session’s prior state, computed at hydration.
Carries no full message vector — expansion is pulled lazily by /history, never eagerly
(spec-068 §13.3).
Fields§
§is_resume: boolWhether this hydration reconstructed a non-empty prior conversation (§13.4).
prior_message_count: usizeCount of non-system messages in the reconstructed stream.
prior_turn_count: usizeApproximate number of turns (count of user messages in the reconstructed stream).
last_active: Option<String>Last-active timestamp, formatted for display (e.g. "2h ago"), when known.
Implementations§
Source§impl SessionResumeInfo
impl SessionResumeInfo
Sourcepub fn from_messages(
messages: &[Message],
last_active_raw: Option<&str>,
) -> Self
pub fn from_messages( messages: &[Message], last_active_raw: Option<&str>, ) -> Self
Compute resume info from an already-reconstructed message stream.
is_resume is evaluated against the raw message stream — at least one non-system
message (User, Assistant, or a tool-bearing message) makes this true, even when
the only assistant message is tool-use-only with no visible text (spec-068 §13.4,
AC-17). This must never be computed against a display-filtered/visible-text-only turn
count — that would false-negative a session interrupted mid-tool-loop as fresh.
§Examples
use zeph_core::session_resume::SessionResumeInfo;
use zeph_llm::provider::{Message, Role};
let messages = vec![Message::from_legacy(Role::System, "system prompt")];
let info = SessionResumeInfo::from_messages(&messages, None);
assert!(!info.is_resume, "system-prompt-only history is fresh, not a resume");Render the neutral CLI/TUI banner line (spec-068 §13.5).
Carries no interrupted/clean-exit qualifier in v1 (§13.10). Returns None when
is_resume is false — callers must not render anything for a fresh conversation
(AC-16).
Trait Implementations§
Source§impl Clone for SessionResumeInfo
impl Clone for SessionResumeInfo
Source§fn clone(&self) -> SessionResumeInfo
fn clone(&self) -> SessionResumeInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SessionResumeInfo
impl RefUnwindSafe for SessionResumeInfo
impl Send for SessionResumeInfo
impl Sync for SessionResumeInfo
impl Unpin for SessionResumeInfo
impl UnsafeUnpin for SessionResumeInfo
impl UnwindSafe for SessionResumeInfo
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,
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request