Skip to content

Compaction separator

The line that marks where the model's view of a long conversation starts once the older turns are summarised — with the summary, and a way to restore them.

On this page
Open

A conversation can outgrow the model’s context window. @aparte/plugin-compaction then asks the model to summarise the older turns, and the model reads that summary in their place from then on. The turns themselves stay where they are, for the person to read: the separator marks the first turn the model still reads word for word.

It sits above that turn’s message, centred, outside the bubble, and says how many messages the summary stands for. Show summary unfolds what the model reads instead of them. Restore asks first, then sends the original messages to the model again, every summary of the conversation included.

  • Summarising: “Summarising the context…”, while the summary is written.
  • Done: the count, Show summary and Restore.
  • Failed: what went wrong, and Retry. Nothing was removed, so the conversation goes on as it was.

A conversation compacted before 0.26, whose summary replaced its first turns, shows the same separator without a count and without Restore: its original messages are no longer there to restore.

ts
import { setupCompaction } from '@aparte/plugin-compaction';

setupCompaction(); // the global config, the current model's window

The separator is drawn by the message bubble from the message’s contextSummary, which the plugin writes on the first turn it keeps, so it needs no markup and is saved with the conversation. When to compact, how much to keep and how the summary is written are on Long conversations.

The separator is .aparte-checkpoint inside the bubble; its actions wear the button recipe, and its text and rules follow the muted text and border tokens. A bubble you draw yourself draws the separator from message.contextSummary.

  • The separator is a group named by the checkpointGroup key (“Context summary”), read before the message it precedes; Show summary is a disclosure button with aria-expanded.
  • Restore asks in place, and the keyboard stays in the transcript once the separator is gone.