AI
New benchmark reveals how context compression hampers long-running AI coding agents
Researchers quantify the hidden costs of summarizing task history when AI agents work beyond their context window limits.
Long-horizon coding agents—AI systems trained to handle extended programming tasks—must contend with a fundamental constraint: language models have finite context windows. When the history grows too large, systems compress or summarize it to continue working. But this summarization can destroy critical information needed to finish the job.
The Trade-Off Problem#
A new research effort called Compact-Bench isolates exactly what gets lost when context gets compressed. Rather than measuring just efficiency or overall success, the benchmark pairs two parallel continuations for the same task: one with the complete history intact, and another relying only on a summary. This side-by-side comparison reveals the damage caused by summarization alone.
What the Benchmark Measured#
The evaluation spans 35 software engineering repairs from SWE-bench, covering 146 agentic work sessions and 106 production chains. Researchers tested 14 different summarizer models and found:
- Damage range: 5–64% of tasks that succeeded with full history failed with summaries only
- Best performer: Claude Opus 4.8 preserved the most repairs
- Worst performer: DeepSeek-Flash caused the most failures
- Prompt variation: With Kimi-K3 as the summarizer, Kimi Code retained the most continuations (19 of 22), while Claude Code preserved the most recurring details (15.0%)
The Information Retention Gap#
LLM-generated summaries retained at most 16.0% of the task-specific details that kept reappearing through the work. By contrast, mechanical extraction—simply pulling relevant items without AI summarization—preserved 79.1%. When the system applied summarization at production boundaries, it retained just 15.7% of necessary context.
Perhaps most telling: certain repairs failed across nearly all approaches. One task couldn't be completed after summary by 13 of 14 backbone models; another failed with all 5 prompt variations tested.
Why It Matters#
The results underscore a fundamental challenge: keeping relevant information in a summary is not the same as preserving what agents actually need to finish. Reliable context compaction requires understanding not just what facts the task requires, but which intermediate states and decisions are essential to continued progress. This gap suggests that better compression strategies must do more than extract information—they must capture the logic of task progression itself.

