# AutoCompact trains coding agents to decide when to compact context

AutoCompact uses a judge to correct compaction decisions, then applies supervised fine-tuning and reinforcement learning with task-success rewards. Reported pass rates rise by 9.2 points on SWE-bench Verified and 5.0 points on SWE-PolyBench Verified, including when a 256K window never overflows.

Language: en
Time zone: America/Los_Angeles
Current time (UTC, cached as of): 2026-11-22T13:08:00.000Z
Query date (America/Los_Angeles): 2026-11-22

HTML: https://didcodexreset.com/news/6ba273d1ea564aeea9faee1a.html

Content language: en
Localization state: sameLanguage

Source: elvis · Published 10/3/2026, 09:21:25

AutoCompact trains a coding agent to decide when to compact context, which working state to keep, and how to resume. A judge reviews the base agent’s compaction decisions and replaces flawed ones before they run. The corrected trajectories are used for supervised fine-tuning, and reinforcement learning with task-success rewards then trains coding and compaction together. The paper is on [arXiv](https://arxiv.org/abs/2610.02163).

Pass rates improve by 9.2 points on SWE-bench Verified and 5.0 points on SWE-PolyBench Verified. The gain holds even with a 256K window that never overflows, so learned compaction still helps when context space is not the limit. The authors describe this proactive compaction as model-harness co-design: the harness provides the compaction mechanism, while the model learns when to invoke it, what to preserve, and how to continue.

Tags: AutoCompact, Coding agents, Context compaction, SWE-bench

[View original post](https://x.com/omarsar0/status/2106416745686995025)
