AutoCompact: Learning When to Compact Context in Long-Horizon Coding Agents
Summary
We augment the agent with a compact() action that can be invoked proactively during execution. Experiments on SWE-bench Verified and SWE-PolyBench Verified show that AutoCompact improves pass rates over the base model by an absolute 9.2% and 5.0%, respectively, achieving pass rates of 39.6% and 24.5%. This mechanism makes compaction a model decision rather than solely a response to context-window pressure. [S1]
Claims
- id: C1 claim: 'The agent is given a compact() action it can invoke during execution.' source: S1 evidence: "We augment the agent with a compact() action that can be invoked proactively during execution."
- id: C2 claim: 'They report a 9.2% and 5.0% absolute pass-rate gain over the base model.' source: S1 evidence: "improves pass rates over the base model by an absolute 9.2% and 5.0%"
- id: C3 claim: 'They report pass rates of 39.6% and 24.5% on the two benchmarks.' source: S1 evidence: "achieving pass rates of 39.6% and 24.5%, respectively"
Verification
- Code available: No official repository URL was found on the abs page or in the HTML text searched on 2026-11-11.
- Reproduced: not reproduced (2026-11-11). Code not run.
- Related work: Live practice notes ao-compaction-when-to-compact and ao-compaction-side-constraints. CliffCompaction in this batch is a different method.
- Limits: No official code URL was found on the abs page or in the HTML text. Numbers are author-reported on two benchmarks with their scaffold and base model.
- License: CC BY 4.0 on the abs page (2026-11-11; icon by-4.0.png; http://creativecommons.org/licenses/by/4.0/). Submitted 1 Oct 2026 (v1). Sources: [S1] https://arxiv.org/abs/2610.02163, v1 (1 Oct 2026). checked_on: 2026-11-11.
When to apply
Use when asking whether a coding agent can learn the timing and contents of compaction, rather than always summarizing at a token threshold.
Facts
- id: F1 claim: 'AutoCompact adds a compact() action the agent can call during a coding trajectory, rather than compacting only under window pressure.' confidence: medium date: 2026-11-11 sources: [S1] license: CC BY 4.0
- id: F2 claim: 'The authors report pass rates of 39.6% on SWE-bench Verified and 24.5% on SWE-PolyBench Verified, stated as 9.2% and 5.0% absolute gains over the base model.' confidence: medium date: 2026-11-11 sources: [S1] license: CC BY 4.0
- id: F3 claim: 'Of the supervised trajectories, they report 24% for compaction triggers, 53% for working-state construction, and 23% for post-compaction continuation.' confidence: medium date: 2026-11-11 sources: [S1] license: CC BY 4.0
Sources
- [S1] arXiv 2610.02163, https://arxiv.org/abs/2610.02163. License: CC BY 4.0. v1 (1 Oct 2026). Accessed 2026-11-11.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Paper is CC BY 4.0.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Source: Xuan Zhang, Longtao Zheng, Cunxiao Du, Bo An, Xin Dong, AutoCompact: Learning When to Compact Context in Long-Horizon Coding Agents (CC BY 4.0).
Cite this
'iinventedlight (AI-assisted)'. 2026. "AutoCompact: Learning When to Compact Context in Long-Horizon Coding Agents." iinventedlight Library, iil:note:vq06qh82, version of 2026-11-11. https://iinventedlight.com/library/notes/2610-02163-autocompact/. License: CC-BY-4.0.
@misc{iil_note_vq06qh82,
author = {{'iinventedlight (AI-assisted)'}},
title = {{AutoCompact: Learning When to Compact Context in Long-Horizon Coding Agents}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-11},
url = {https://iinventedlight.com/library/notes/2610-02163-autocompact/},
note = {Permanent ID iil:note:vq06qh82. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/2610-02163-autocompact.md.