pub struct SerializableSession {Show 13 fields
pub id: String,
pub user_id: String,
pub messages: Vec<SerializableMessage>,
pub system_prompt: String,
pub created_at: DateTime<Utc>,
pub token_count: usize,
pub metadata: SessionMetadata,
pub allowances: Vec<Allowance>,
pub budget_snapshot: Option<BudgetSnapshot>,
pub escape_state: Option<EscapeState>,
pub workspace_path: Option<String>,
pub model: Option<String>,
pub git_state: Option<GitState>,
}Expand description
Serializable session state (for persistence).
Includes full security state: allowances, budget snapshot, escape handler state, and workspace path. This ensures “Allow Session” approvals, budget spend, and escape decisions survive daemon restarts.
Fields§
§id: StringSession ID.
user_id: StringUser ID (hex).
messages: Vec<SerializableMessage>Messages.
system_prompt: StringSystem prompt.
created_at: DateTime<Utc>Created at.
token_count: usizeToken count.
metadata: SessionMetadataMetadata.
allowances: Vec<Allowance>Session allowances (persisted so “Allow Session” survives restart).
budget_snapshot: Option<BudgetSnapshot>Budget snapshot (persisted so budget is not reset on restart).
escape_state: Option<EscapeState>Escape handler state (persisted so “Allow Always” paths survive).
workspace_path: Option<String>Workspace path this session belongs to.
model: Option<String>Model used for this session (e.g. “claude-sonnet-4-20250514”).
git_state: Option<GitState>Git state placeholder (branch, commit hash) for future worktree support.
Implementations§
Source§impl SerializableSession
impl SerializableSession
Sourcepub fn to_session(&self) -> AgentSession
pub fn to_session(&self) -> AgentSession
Convert back to an AgentSession.
Restores full security state: allowances, budget, and escape handler.
Trait Implementations§
Source§impl Clone for SerializableSession
impl Clone for SerializableSession
Source§fn clone(&self) -> SerializableSession
fn clone(&self) -> SerializableSession
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SerializableSession
impl Debug for SerializableSession
Source§impl<'de> Deserialize<'de> for SerializableSession
impl<'de> Deserialize<'de> for SerializableSession
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>,
Source§impl From<&AgentSession> for SerializableSession
impl From<&AgentSession> for SerializableSession
Source§fn from(session: &AgentSession) -> Self
fn from(session: &AgentSession) -> Self
Auto Trait Implementations§
impl Freeze for SerializableSession
impl RefUnwindSafe for SerializableSession
impl Send for SerializableSession
impl Sync for SerializableSession
impl Unpin for SerializableSession
impl UnsafeUnpin for SerializableSession
impl UnwindSafe for SerializableSession
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,
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
self file descriptor. Read moreSource§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