Compaction Recovery
The operational view of surviving a context-window reset mid-session — what happens, and what the operator sees.
A long session can exhaust its context window and be compacted — the window is summarised and reset, and un-checkpointed working state is lost. Compaction recovery is the protocol that carries the mission across that reset. The architectural mechanism — the sidecar, the hooks, the checkpoint entry — is documented under memory; this page is the operational view: what happens, in order, and what the operator notices.
What happens, operationally
- Continuously, before compaction. As LISA works, it keeps a small working-state snapshot current — active missions, open dispatches, unresolved decisions, pending directives, and a prose summary of where things stand. Each update also heartbeats the session registry, so the other door sees live state.
- The moment before the reset. A pre-compaction hook reads that snapshot and posts it to the gateway as a checkpoint. This is fire-and-forget with a short timeout — it cannot be allowed to hang the session.
- The reset. The window is compacted. In-context working state is gone.
- Immediately after. A session-start hook fetches the checkpoint back, composes a narrated recap, and injects it — so LISA resumes already knowing the mission it was mid-way through, rather than greeting the operator as a stranger.
What the operator sees
Ideally, almost nothing. A well-recovered session simply continues — it references the in-flight work as its own recent activity rather than announcing that a reset occurred. There is no "where were we?"; the recap has already answered that internally.
The fallback chain
Recovery degrades in a fixed order: the gateway checkpoint first; if the gateway is unreachable, a local temporary copy of the snapshot; and if neither is available, a minimal message that at least names the active mission. The session never resumes completely blind if any layer of the chain survived.
Why this exists
Without it, every context reset would be a small amnesia — dropped dispatches, forgotten decisions, a mission restarted from scratch. Compaction recovery makes the context window an implementation limit rather than a memory limit: the window is finite, but the session's continuity is not bounded by it.