Expand description
Archive lifecycle, browsing, and previews for agent session zones.
Structs§
- Archive
Summary - 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>:currenttoagent:<defId>:archive:<now_ms>. - clear_
local_ current_ zone - Delete
output.state.json+outputfrom a per-channel:currentzone, 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 anoutput.state.jsonsnapshot’s bytes, or("", 0)when they don’t parse or have nonodesarray. The preview is the firstuser_message, skipping a leading “# Session Context” bootstrap message when a later one exists, collapsed to one line of at most 240 chars.