Maximising Transparency in Context Compaction Improves Retention of Facts and Commitments for Lightweight Coding Agents
Felix Woolford
Abstract
Long coding agent sessions outgrow the model's context window, so agents compact: older history is replaced by something shorter, usually a model-written summary. A summary selects and rewords, and the agent cannot see what was lost. Existing work has explored a range of compaction techniques, but comparatively little attention has been paid to their effectiveness with lightweight models, including those deployed locally or used for high-volume workloads. Here, we present transparent-compact, a simple deterministic method for the open-source Pi coding agent, designed specifically for use with such models and with the purpose of maximising the transparency of the agent's view of its own compacted context. It guarantees that user and assistant prose in its context is unchanged by a model or algorithm, and explicitly flags where compaction has stripped information. We compare it with Pi's default model-written summary compaction and with pi-vcc, a popular deterministic method with similar methods but without verbatim retention of prose. Our benchmarks run on four models of varying performance levels, with emphasis on Qwen3.8-27B: a lightweight model at the top end of what consumer hardware can serve locally. On sets probing commitments (rules the user set which exist only in the conversation) and recall of facts, transparent-compact matched or outperformed both alternatives. In particular, it showed an advantage in avoiding confident blunders, i.e. assertion of false information as opposed to recognizing that something was not recalled. Even with a frontier model, its advantage was present but smaller. We argue that transparent-compact spares lightweight models from reasoning or searching their way around what compaction lost, and results in improved recall and application of information as a result, without the need for task or context-specific structuring of the session history.
Create a lesson
Related papers
Co-Evolving Acting and Forecasting for Language Agents
Haofei Yu, Yixing Chen, Yining Zhao et al.
Scaling Discovery Requires Forgetting
Shangyin Tan, Ben Zhou, Lakshya A Agrawal et al.
PhySGA: A Physics-Space Grounded Agentic Framework for Generalizable and Interactive 3D Composition
Weichen Lyu, Chong Xia, Mingyu Dong et al.
ActiveEvidence: Decision-Focused Evidence Graphs with Verifiable Acquisition Gaps
Miaobo Hu, Shuhao Hu, Xiaobo Guo et al.
The Wealth of Agents: Scaling Agentic AI Across Developers
Austin W. Hanjie, Carlos E. Jimenez, Zirui Wang et al.
SafeAdapt-Poker: Counterfactual Risk Calibration for Budgeted Adaptation under Opponent Shift
Miaobo Hu, Shuhao Hu, Xiaobo Guo et al.