Prune the Summary, Not the History: Source-Judged Compaction for Long-Horizon Agents
Organizations: Department of Computer Science, University of Virginia
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.
Figures & tables
| Method | Summary | Train-Free | Drop-in |
| ACE ( Zhang et al., 2026 ) | ✗ | ✓ | ✗ |
| Mem1 ( Zhou et al., 2025 ) | ✗ | ✗ | ✗ |
| ACM ( Li et al., 2026 ) | ✗ | ✗ | ✗ |
| Fast-Jev ( Tran, 2026 ) | ✗ | ✓ | ✓ |
| ReSum 1 ( Wu et al., 2025 ) | ✓ | ✗ | ✗ |
| SUPO ( Lu et al., 2025 ) | ✓ | ✗ | ✗ |
| Section | Entries | Unsupported (%) |
|---|---|---|
| Exact identifiers | 14,444 | 3.4 |
| Constraints/Rules | 4,183 | 11.1 |
| Decisions | 4,270 | 21.0 |
| Open TODOs | 2,600 | 67.7 |
| Pending user asks | 1,384 | 86.1 |
| All | 26,881 | 17.9 |
| Method | Average (168) | Easy (57) | Medium (48) | Hard (63) | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Acc. | Pass 3 | Steps | Peak | Acc. | Pass 3 | Steps | Acc. | Pass 3 | Steps | Acc. | Pass 3 | Steps | |
| Agent: GPT-5.6 Luna / Compressor: GPT-5.6 Luna | |||||||||||||
| No compression | 84.1 0.9 | 78.6 | 12.1 | 12.53 | 97.7 1.0 | 93.0 | 9.6 | 86.8 2.4 | 81.2 | 12.2 | 69.8 0.0 | 63.5 | 14.4 |
| FIFO | 53.2 1.2 | 45.2 | 30.0 | 7.14 | 95.9 2.0 | 93.0 | 9.6 | 47.9 4.2 | 37.5 | 33.7 | 18.5 3.3 | 9.5 | 42.8 |
| LLMLingua | 39.5 1.9 | 29.2 | 34.1 | 8.59 | 83.6 2.7 | 68.4 | 16.9 | 25.7 4.3 | 12.5 | 38.9 | 10.1 1.8 | 6.3 | 46.0 |
| LLMLingua-2 | 71.4 2.3 | 61.3 | 19.2 | 10.53 | 97.7 2.7 | 94.7 | 8.7 | 77.8 2.4 | 66.7 | 17.6 | 42.9 6.3 | 27.0 | 30.0 |
| Method | Average (95) | 1-APP (42) | 2-APP (22) | 3-APP (31) | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Acc. | Pass 3 | Steps | Peak | Acc. | Pass 3 | Steps | Acc. | Pass 3 | Steps | Acc. | Pass 3 | Steps | |
| Agent: GPT-5.6 Luna / Compressor: GPT-5.6 Luna | |||||||||||||
| No compression | 82.1 4.8 | 75.8 | 11.2 | 7.02 | 92.9 4.1 | 88.1 | 7.6 | 81.8 4.5 | 77.3 | 10.9 | 67.7 8.5 | 58.1 | 16.2 |
| FIFO | 62.1 1.8 | 54.7 | 23.2 | 3.48 | 81.7 1.4 | 73.8 | 10.3 | 56.1 2.6 | 50.0 | 28.2 | 39.8 3.7 | 32.3 | 37.0 |
| LLMLingua | 58.2 2.2 | 46.3 | 20.2 | 4.16 | 75.4 6.0 | 61.9 | 9.8 | 59.1 4.5 | 45.5 | 20.0 | 34.4 4.9 | 25.8 | 34.4 |
| LLMLingua-2 | 76.1 1.2 | 68.4 | 14.4 | 4.14 | 89.7 1.4 | 83.3 | 8.0 | 81.8 0.0 | 77.3 | 14.0 | 53.8 4.9 | 41.9 | 23.2 |
| AppWorld | OfficeBench | |||
| GPT | M3 | GPT | M3 | |
| Prompting tokens (K) | 112.8 | 142.6 | 51.0 | 57.5 |
| SJC tokens (K) | 103.8 | 138.5 | 50.4 | 53.5 |
| (%) | ||||
| Entries pruned (%) | 18.5 | 13.6 | 21.3 | 13.0 |
| Summary length (%) | ||||
| AppWorld | OfficeBench | |||
|---|---|---|---|---|
| GPT | M3 | GPT | M3 | |
| Prompting | 64.3 | 55.4 | 68.4 | 74.7 |
| +SJC (Self) | 75.6 | 50.0 | 60.0 | 70.5 |
| +SJC (Jev) | 73.2 | 62.5 | 73.7 | 76.8 |
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
| Symbol | Description |
|---|---|
| Agent and Environment | |
| LLM agent that solves a task by interacting with an environment | |
| Fixed prompt containing the system prompt and the task instruction; never compressed | |
| Action taken by the agent at step | |
| Environment output received at step | |
| Rollout of interaction steps | |
| System | Commit | Facts | Decisions | Plans | Intent |
|---|---|---|---|---|---|
| OpenClaw (default) | d2f8755 | ✓ | ✓ | ✓ | ✓ |
| OpenClaw (safeguard) | d2f8755 | ✓ | ✓ | ✓ | |
| Hermes Agent | 302c5d9 | ✓ | ✓ | – | ✓ |
| AG2 v1.0 | e1c8857 | ✓ | – | – | |
| AG2 Classic | 86fa5cc | – | – | – | – |
| Codex CLI | 5fe2152 | ✓ | ✓ | ✓ |
| Unsupported (%) | ||||
|---|---|---|---|---|
| Boundary | All | Reas. | Count | |
| 1st | 243 | 29.2 | 54.9 | 4.3 |
| 2nd | 152 | 16.6 | 39.6 | 3.9 |
| 3rd+ | 272 | 12.6 | 29.6 | 3.8 |
| First seen as | ||||
|---|---|---|---|---|
| Unsupported | 20.5 | 10.9 | 5.3 | 4.5 |
| Supported | 22.6 | 14.4 | 10.1 | 6.6 |
| Failure pattern | Support of executed entry | ||||||||
| Scenario | Failed | RC | ID | CS | Other | Unrelated | Unsupported | Contradicted | Supported |
| 22cc237 | 3 | 2 | 1 | 2 | |||||
| 29caf6f | 9 | 9 | 9 | ||||||
| 2a163ab | 2 | 1 | 1 | 1 | 1 | ||||
| 60d0b5b | 1 | 1 | 1 | ||||||
| 6104387 | 3 | 3 | |||||||
| Judge | Provenance | Correctness |
|---|---|---|
| Jev | 0.905 [0.857, 0.950] | 0.733 [0.635, 0.868] |
| GPT-5.6 Luna | 0.792 [0.732, 0.855] | 0.639 [0.536, 0.787] |