Agent misreads · T2 Context & memory

Context compaction

Last reviewed 3 Nov 2026by Pratima Chainani

When an agent's context fills up, the harness replaces the earlier conversation with a summary and carries on. The task usually survives the summary. Standing rules often don't.

Long agent sessions hit the context limit. The harness then compacts: it asks the model to summarise what has happened so far, drops the original turns and keeps working from the summary. Builders mostly test that the work survives this step. A GitHub pull request on 26 October 2026 put the usual check plainly: “a compaction drill proves nothing pending is lost.” That drill looked at tasks and pending items kept in a file on disk, in one run, and passed 11 of 11 checks.

Tasks are the easy case. They live in files, tickets and the repo, so the agent can read them again after the summary. Rules are different. “Don’t edit the tests”, “never touch the payments module”, “ask before you delete” are often said once, in chat, and exist nowhere else.

A paper submitted on 22 October 2026 tested this directly. It kept one scaffold fixed (OpenCode), tried five compaction strategies with three frontier models, and ran PaperBench, ProgramBench and PostTrainBench. On ProgramBench, the first summary “drops about one third of the task’s anticheating rules on average”, and the loss grows with each further compaction. In real coding sessions (the SWE-chat set), how-to-work and what-not-to-do instructions were dropped around six times more often than what-to-build instructions. No strategy beat the default, where the model summarises itself.

The authors’ explanation is the useful part: the objective is fixed and the progress is on disk, so most of what a summary loses can be recovered. Constraints that exist nowhere else can’t. That is why a run can finish green and still have broken a rule nobody re-checked.

The limits: the numbers here come from the paper’s abstract; the task count and how rules were counted are in the full text. One scaffold, three models. A separate issue report (anthropics/claude-code #104779, 24 October 2026) shows the same pattern in one trajectory: a summary dropped a required int64 type and the self-tests then agreed with the wrong code.

Common misread

If the task still finishes after compaction, nothing important was lost.

The task finishes because it lives on disk. The rules said only in chat are the part the summary drops.

For your code

Keep every standing rule in a file the harness re-injects after each compaction, not only in chat. Test compaction with planted rules (a forbidden file, a required type), not just with pending tasks.

For your roadmap

When you compare agent harnesses, ask how they carry constraints across a summary, and count rule violations after long sessions, not only task completion.

Sources

  1. Salle, Bhatnagar, Bethge, Abdelnabi, Andriushchenko, Benchmarks Are Surprisingly Compaction-Friendly (arXiv 2610.31778v1) · 22 Oct 2026
  2. chanjdaniel/agent-team PR #14, compaction drill · 26 Oct 2026
  3. anthropics/claude-code issue #104779, summary dropped a required type · 24 Oct 2026

More on T2 Context & memory

Every term, by layer