WEEK 1 · LESSON 6 · TOPIC 6 OF 26 · What Happens When the Context Fills

What Happens When the Context Fills

Lesson progress

0% Complete

SECTION 1 OF 1

In this topic · 1 sections
  1. Overview

Overview

When the context approaches its limit, agent platforms use a process commonly described as compaction or compression.

Before compaction, the model may have access to the complete conversation history. Every message, tool call, output, and correction is present.

At a threshold below the absolute limit, the system compresses a large portion of the history. It summarizes and densifies the information so the conversation can continue with fewer tokens.

The process can be visualized as a press compressing a large block of context into a smaller block. Information that previously occupied most of the window may be reduced to a much smaller fraction.

Compaction makes long-running sessions possible, but it is not lossless. The system may:

  • Remove detailed tool outputs.
  • Collapse several messages into a summary.
  • Omit a minor decision.
  • Lose the wording of an important correction.
  • Preserve the result while dropping the path used to reach it.
  • Remove an earlier detail that becomes relevant later.

The problem is not that compaction always fails. The problem is that the user may not know which detail was lost.