Skip to main content

List durable compaction records

GET 

/session/compactions

Lists the session's compaction records, newest first. When a conversation grows close to the model's context limit, Peen asks a model to summarize the oldest messages and sends the summary in their place from then on. Each compaction record holds that summary and the exact range of stored messages it replaced. A record never changes once written.

A later compaction summarizes the current summary plus the next messages, so its range starts where the earlier one started, and parentCompactionId points at the record it replaces. Follow the parent links to rebuild the whole lineage. Messages keep the compactionId of the compaction that first summarized them. Child agents keep their own compactions, under GET /session/agents/{agentRunId}/compactions, not here.

  • Ordering: by createdAt descending, then id descending.
  • Paging: limit (1 to 200, default 50) and offset (default 0). hasMore is true when at least one more record exists after this page.
  • Errors: 400 VALIDATION_FAILED for a limit or offset outside the allowed values. 404 SESSION_NOT_FOUND when no session has the X-Session-ID ID.

Request​

Responses​

One page of the session's compaction records, newest first.

Response Headers
    X-Session-ID

    The session this response belongs to. For session-scoped requests it echoes the X-Session-ID request header; for POST /sessions/open and POST /sessions/system it is the session that was opened or created.

    X-Request-ID

    The request's correlation ID. When the request carried an X-Request-ID header holding a UUID, Peen echoes it; otherwise Peen generates a new UUID. The controller log records the same value for this request.