Expand description
Session archival and cleanup (Phase 3.3 — ultra-long-sessions).
Responsibilities:
- Periodic sweep: archive sessions inactive for
inactive_daysdays by compressing their FileStore “output” file toarchive_dir/<block_id>.jsonl.gzand freeing the FileStore entry.
Archives are never deleted: AgentMux keeps agent history forever.
The sweep archives through the same archive_session_output the RPC
handlers in server/app_api/session.rs call; those handlers also use
restore_session_output and read_session_output from this module.
Structs§
- Session
Archiver - Periodic session archival.
- Session
Archiver Stats - Statistics from a single sweep run.
Constants§
- META_
SESSION_ ARCHIVED_ AT - Unix ms when the session was last archived.
- META_
SESSION_ ARCHIVED_ BYTES - Byte count before compression (original output size).
- META_
SESSION_ ARCHIVE_ PATH - Absolute path to the
.jsonl.gzarchive file.
Functions§
- archive_
session_ output - Archive the FileStore “output” file for
block_id: - archive_
session_ output_ with archive_session_outputwith the global transcript store given (tests install none).- default_
archive_ dir - Returns
~/.agentmux/archives/, orNoneif the home directory cannot be determined. - read_
session_ output - Read the raw session output bytes, whether from FileStore (live) or archive.
Returns
(bytes, line_count). - read_
session_ output_ with read_session_outputwith the global transcript store given (tests install none).- restore_
session_ output - Restore an archived session back into FileStore: