Skip to main content

archive_session_output

Function archive_session_output 

Source
pub fn archive_session_output(
    mstore: &Arc<Store>,
    filestore: &Arc<FileStore>,
    block_id: &str,
    archive_dir: &Path,
) -> Result<(u64, i64), String>
Expand description

Archive the FileStore “output” file for block_id:

  1. Read bytes from FileStore.
  2. Compress to archive_dir/<block_id>.jsonl.gz.
  3. Delete the FileStore entry to reclaim SQLite space.
  4. Write archive meta keys to the block.

Returns (archived_bytes, archived_at_ms). If the FileStore entry is missing or empty, returns (0, now_ms) — no-op.

The bytes come from where the pane reads them (TranscriptSource): the agent’s own zone in the global transcript store when the block is a defined agent’s and the zone has content, else the block’s own copy. Only the block’s own files are deleted (the zone holds the agent’s whole record and is not this block’s to delete); with no block copy that delete finds nothing.