Skip to main content

Module session_manager

Module session_manager 

Source
Expand description

Session management for resuming conversations.

This module provides functionality for:

  • Saving sessions to disk
  • Listing previous sessions
  • Resuming sessions by ID
  • Managing session lifecycle

Structs§

OfflineQueueState
Persisted queue state for recovery after restart/crash.
QueuedSessionMessage
Persisted queued message for offline/degraded mode.
SavedSession
A saved session containing full conversation history
SessionContextReference
Durable context-reference metadata attached to a user message.
SessionManager
Manager for session persistence operations
SessionMetadata
Session metadata stored with each saved session

Functions§

create_saved_session
Create a new SavedSession from conversation state
create_saved_session_with_mode
Create a new SavedSession from conversation state with optional mode label
default_sessions_dir
Resolve the default session directory path (~/.zagens/sessions).
format_session_line
Format a session for display in a picker
prune_workspace_snapshots
Prune snapshots older than max_age for workspace.
truncate_id
Truncate a session ID to 8 characters for compact display. Returns a &str borrowing from the input — no allocation.
update_session
Update an existing session with new messages