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§
- Offline
Queue State - Persisted queue state for recovery after restart/crash.
- Queued
Session Message - Persisted queued message for offline/degraded mode.
- Saved
Session - A saved session containing full conversation history
- Session
Context Reference - Durable context-reference metadata attached to a user message.
- Session
Manager - Manager for session persistence operations
- Session
Metadata - Session metadata stored with each saved session
Functions§
- create_
saved_ session - Create a new
SavedSessionfrom conversation state - create_
saved_ session_ with_ mode - Create a new
SavedSessionfrom 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_ageforworkspace. - truncate_
id - Truncate a session ID to 8 characters for compact display.
Returns a
&strborrowing from the input — no allocation. - update_
session - Update an existing session with new messages