Skip to main content

Module archive

Module archive 

Source
Expand description

Archive lifecycle, browsing, and previews for agent session zones.

Structs§

ArchiveSummary
A single archive row. Mirrors the shape of RecentSessionRow’s preview fields so the frontend can reuse the same row component.

Constants§

MAX_PREVIEW_SNAPSHOT_BYTES
Snapshots larger than this are not parsed for a preview, so a corrupted one can’t stall a listing.

Functions§

archive_session
Archive agent:<defId>:current to agent:<defId>:archive:<now_ms>.
clear_local_current_zone
Delete output.state.json + output from a per-channel :current zone, only for files that are present (so absence isn’t logged as an error). Best-effort — used after the global-preferred archive has persisted the content, to retire this channel’s (subset) copy.
collapse_preview
Collapse newlines + extra whitespace, cap at 240 chars. Output is safe to render inline in a single-line preview row.
list_archives
List archive zones for definition_id, newest first.
snapshot_preview
(preview, node_count) from an output.state.json snapshot’s bytes, or ("", 0) when they don’t parse or have no nodes array. The preview is the first user_message, skipping a leading “# Session Context” bootstrap message when a later one exists, collapsed to one line of at most 240 chars.