Manuscript Offprint

arXiv:2610.31778

Benchmarks Are Surprisingly Compaction-Friendly

Jeanne Salle, Hardik Bhatnagar, Matthias Bethge, Sahar Abdelnabi, Maksym Andriushchenko

ABSTRACT

Long horizon agentic tasks are now pushing LLM agents past their context window. To continue the task, the agent scaffold has to free up the context window, a process known as context compaction. Compaction is generally lossy by design: agents can silently lose task constraints, instructions, or their reasoning behind earlier decisions. Although compaction is a standard component of coding agent scaffolds, it has not been studied systematically with frontier models on realistic, long horizon agentic tasks. Previous work evaluate smaller open weight models on toy or synthetic trajectories. We fix the agent scaffold (OpenCode), implement five compaction strategies inside it, and evaluate three frontier models on three long horizon benchmarks (PaperBench, ProgramBench, PostTrainBench). For the two 1M context models, the compaction threshold does not measurably affect the task performance, whereas GPT-5.3-Codex, the model with the smallest context window, performs worse at lower thresholds on PaperBench and, less clearly, on PostTrainBench. No compaction method outperforms default self-summarization, and methods that discard more content cost some models up to 20 points while leaving other models the same. Compaction can, however, silently remove task constraints: on ProgramBench, the first compaction summary already drops about one third of the task's anticheating rules on average, and this rises monotonically with the number of compactions. On real user-agent sessions from SWE-chat, instructions about how the agent should work and what it should not do are dropped around 6 times more than specifications of what to build. We argue that current benchmarks are compaction-friendly: i.e., the objective is fixed and the agent's progress stays on disk, so most of what compaction discards can be recovered, except constraints that don't exist anywhere else.

1 INTRODUCTION

LLM agents can now run for multiple hours on a single task autonomously. For example, a single run of PostTrainBench (Rank et al., 2026) or ProgramBench (Yang et al., 2026) produces on average several hundreds of thousands of tokens, more than many LLMs' context windows. Widely used agent scaffolds like Claude Code, Codex CLI, Gemini CLI, Cursor, OpenHands, and OpenCode mostly handle this with some form of summarization: when the context is near the limit, the scaffold asks a model to summarize the work so far, discards the current context, and continues from the summary (Cassano & Rush, 2026; Anthropic, 2026a; Smith, 2025; OpenCode contributors, 2026). This process is called context compaction.

Most compaction methods are lossy by design. If the summary removes something, the agent can then lose task constraints, certain instructions, or the chain of thought behind previous decisions. This raises two questions: can the agent still solve the task, and does it still respect the rules it was given? Previous works have shown that constraints specified by the user often do not survive

∗^{*}Equal contribution.

†^{\dagger}Equal supervision.

Figure

Figure 1: Compaction keeps what the agent can re-read from disk and drops some of the rules it cannot. Left: overview of a ProgramBench run. The task prompt states the goal and anti-cheating rules: no copying or vending the reference, no internet access, and an original implementation that does not derive from or wrap the reference. At each compaction the agent replaces its context with a summary. The goal and the agent's progress survive, because the agent can re-read its files, the rules exist only in the context, so a rule the summary discards is lost. On average, around one of the three rules is missing after the first compaction and around two after the tenth. Right: (1) for the 1M context models, task scores barely change when compaction is forced at thresholds from 160K to 380K tokens; (2) rules are dropped more often as compactions accumulate on ProgramBench, and on real user sessions from SWE-chat, compaction drops process instructions (“how to work”) and scope exclusions (“don’t touch X”) far more often than feature requirements (“what to build”).

compaction (Wang et al., 2026). Other work compares compaction with other context management methods on downstream accuracy, but on long context question answering or web search, where the long input is given upfront (Zhang et al., 2025; Wu et al., 2025; Sun et al., 2025). However, none of these studies measure the downstream effect of compaction on realistic long horizon agentic tasks with frontier models, where the context is generated by the agent itself.

When designing an agent scaffold we therefore lack basic answers to questions like: does the compaction threshold (the number of tokens at which compaction is triggered) matter? Does the compaction method matter? Can a cheaper model write the summary? Does compaction remove the constraints that make it safe to run an agent autonomously for a long time? To the best of our knowledge, no prior work has answered these questions with frontier agents on realistic long-horizon benchmarks.

This paper. We organize our work around these questions, which we answer with controlled experiments. We use the OpenCode as our fixed agent scaffold, a popular open source agent scaffold, so that we can separate the effect of the compaction strategy from that of the scaffold. We implement five compaction methods inside it and evaluate four frontier models (Claude Opus 4.6, GPT-5.3-Codex, GPT-5.4, Gemini 3.1 Pro Preview) on three long horizon agentic benchmarks: PaperBench (Starace et al., 2025), ProgramBench (Yang et al., 2026), and PostTrainBench (Rank et al., 2026). We find:

• Q1: Does the compaction threshold matter? (Section 4.1) Not for the two 1M context models: task performance does not meaningfully change across compaction thresholds swept from 160K to 380K tokens. GPT-5.3-Codex, the oldest model we tested and the one with the smallest context window (400K), performs worse at lower thresholds on PaperBench and, less clearly, on PostTrainBench, although it is compacted at the same absolute thresholds as the other models.

• Q2: Does the compaction strategy matter? (Section 4.1) No compaction strategy consistently beats default self summarization, including making compaction “lossless” by writing the pre-compaction context to a file on disk. However, strategies that discard more, such as removing reasoning blocks or summarizing with a smaller model, can cost some models up to 20 points on PaperBench, while leaving other models the same, so a compaction method validated on one model does not necessarily transfer to another.

• Q3: Does compaction remove task constraints? (Section 4.2) Yes: on ProgramBench, the first compaction summary already drops around one of the task's three anti-cheating rules (no copying the reference, no internet access, an original implementation), this grows with the number of compactions, and models differ a lot in how much they drop (Table 3).

• Q4: Are current benchmarks compaction-friendly? (Section 4.2) We argue that they are: most benchmarks have a fixed objective, run without user input, and give the agent a persistent filesystem, so much of what compaction discards can therefore be recovered by re-reading the agent's own artifacts. In real interactive sessions, much of the context consists of user instructions that exist nowhere else. On real user-agent sessions from SWEchat (Baumann et al., 2026), compaction drops instructions about how the agent should work and what it should not do 6 times more often than specifications of what to build.

References (29)