Skip to main content

Module session

Module session 

Source
Expand description

Session management for the coding agent.

Manages conversation sessions as append-only trees stored in JSONL files. Each session entry has an id and parent_id forming a tree structure.

Structs§

BranchInfo
Information about where a session branched from
BranchSummaryEntry
Branch summary entry for abandoned branches
CompactionEntry
Compaction entry for context window management
CustomEntry
Custom entry for extensions to store extension-specific data
CustomMessageEntry
Custom message entry for extensions to inject messages into LLM context
LabelEntry
Label entry for user-defined bookmarks/markers on entries
ModelChangeEntry
Model change entry
ModelInfo
Model information
NewSessionOptions
New Session Options.
SessionContext
Context built from session entries for the LLM
SessionEntry
Session entry - a simple struct for backward compatibility This wraps the internal enum representation
SessionEntryBase
Base fields for all session entries (internal use)
SessionHeader
Session header stored as the first line in JSONL files
SessionInfo
Session metadata for listing
SessionInfoEntry
Session metadata entry (e.g., user-defined display name)
SessionManager
Manages conversation sessions as append-only trees stored in JSONL files.
SessionMessageEntry
Message entry with AgentMessage content
SessionMeta
Session metadata stored separately from entries (backward compatibility)
SessionStats
Session Stats.
SessionTreeNode
Tree node for get_tree()
ThinkingLevelChangeEntry
Thinking level change entry
Usage
Usage statistics from an assistant message

Enums§

AgentMessage
Agent message roles
AssistantContentBlock
Content block for assistant messages
ContentBlock
Content block for text or image content
ContentValue
Content can be string or array of content blocks
FileEntry
Raw file entry (includes header and internal enum)
SessionEntryEnum
All possible session entries (internal enum)

Constants§

CURRENT_SESSION_VERSION
Current session version for migrations

Functions§

find_recent_session_path
Find the path of the most recent session for the given working directory.
get_default_session_dir
Get default session dir.
resolve_session_path
Resolve a session file path from user input, handling relative paths and ~.

Type Aliases§

EntryId
Type alias for entry IDs (for backward compatibility)