arXiv:2610.20927cs.CLOct 2026

Manuscript Offprint

arXiv:2610.20927

Prune the Summary, Not the History: Source-Judged Compaction for Long-Horizon Agents

Guanghui Min, Chen Chen

Abstract

Long-horizon LLM agents rely on context compaction: when the interaction history outgrows the context window, a compressor replaces it with a natural-language summary. We show that these summaries contain more than a record of what happened. Compaction prompts ask for decisions and next steps, so each summary mixes facts established by the environment with reasoning written by the compressor, and the agent cannot tell the two apart afterwards. In an analysis of a widely used structured compressor, 83% of failed runs trace back to an action that carries out a specific summary entry, most of which no environment output supports. We propose Source-Judged Compaction (SJC), a training-free post-processing step that scores each summary entry for whether it has a source in the environment outputs or the previous summary, and removes the entries that do not. It changes neither the agent nor the compressor and adds one inexpensive judge request per compaction. The judge is Jev, a non-generative decision model that answers the source question with a calibrated probability instead of text. On AppWorld and OfficeBench with two agent models, SJC improves cross-run reliability over the underlying compressor by 2.1%–8.9% without increasing the agent's token usage. Our code is available at https://github.com/GuanghuiMin/sjc.

1 Introduction

Long-horizon agentic tasks require LLMs to plan, use tools, and adapt to environmental feedback across extended interactions (Xu et al., 2026; Wang et al., 2024). During execution, tool outputs, failed attempts, intermediate results, and reasoning traces continually accumulate, making the context increasingly expensive to process and difficult to navigate. This problem persists even with large nominal context windows, whose effective use of distant information degrades with context length (Liu et al., 2024; Hsieh et al., 2024). Context compaction is therefore essential for scalable long-horizon agents.

General compaction methods select or rewrite tokens from static prompts and documents (Jiang et al., 2023; Pan et al., 2024), but do not directly account for subsequent agent execution. Agent-specific methods such as ReSum, SUPO, and ACM instead modify or post-train the agent to manage compressed contexts (Wu et al., 2025; Lu et al., 2025; Li et al., 2026). In many deployed systems, however, the agent is fixed or accessible only through an API. OpenClaw, DeepSeek Harness, and Codex therefore invoke a separate compressor that replaces older interactions with a natural-language checkpoint (OpenClaw Contributors, 2026a; DeepSeek-AI, 2026; OpenAI, 2026a), while ACON and PAIR improve the compression prompt without modifying the downstream agent (Kang et al., 2026; Min et al., 2026b).

Such checkpoints do more than shorten history: they periodically reconstruct the state from which the agent continues, including its progress, constraints, and future actions. Errors in this reconstruction can therefore alter subsequent execution (Min et al., 2026a,b). For example, when a user asks to reply to a friend with movie titles “as per their request”, the compressor records the next step as sending the comma-separated movie list; the agent then sends every title it found, including those the friend did not ask for. The compressor wrote this plan itself, but after compaction the agent cannot tell it from a fact the environment established. Such cases are common: in our analysis of a widely used structured compressor, 67.7% of the pending work it records has no source in the environment outputs, and 29 of 35 failed runs trace back to an action that carries out a specific summary entry. This suggests filtering summary entries by their provenance. Whether an entry is supported by an environment output or by the pre-

∗^{*}Corresponding author.

vious summary can be checked against the history at compaction time, without knowing how the rest of the task will unfold.

We introduce SJC (Source-Judged Compaction), a lightweight plug-in that prunes unsupported entries from generated summaries. Given a structured natural-language summary, SJC splits it into entries, retrieves relevant environment outputs, and asks a probabilistic judge whether each entry contains information that came from those outputs or from the previous summary, as opposed to only plans, decisions, or interpretations of the task. Entries without such a source are removed as complete units, while retained entries remain identical to the compressor's output. The pruned summary is then shown to the agent and used as the previous summary at the next compaction. SJC requires no modification to the agent, the compressor prompt, or the runtime, and adds no summary-generation call. Our contributions are threefold:

  • Analysis of Compaction Summaries: We survey 29 compaction prompts from widely used agent systems and find that most ask the compressor for decisions and next steps. Analyzing the resulting summaries, we show that much of this reasoning has no source in the environment outputs, that it is regenerated at every compression boundary, and that most failed runs follow a specific summary entry.

  • Source-Judged Compaction: We develop a training-free post-processing step that decomposes a structured summary into entries, retrieves relevant environment evidence, and removes the entries that a source judge finds unsupported. The method preserves the natural-language summary interface and attaches to existing agent systems without modifying them.

  • Empirical Effectiveness: Across AppWorld (Trivedi et al., 2024) and OfficeBench (Wang et al., 2024), using both GPT-5.6 Luna (OpenAI, 2026b) and MiniMax-M3 (MiniMax, 2026), SJC improves cross-run reliability over the underlying prompting-based compressor in all four settings, with the largest gains on hard and multi-application tasks, without increasing the agent's token usage.

References (22)