Software engineering agents accumulate large amounts of tool observations (file contents, logs, etc.) in their context, making long interactions costly. This paper introduces LOHA, a context layout that compresses older observations into soft tokens while keeping the agent's own turns and the most recent K observations as text. ACD trains the agent to use this compressed representation by distilling predictions from the full-text base model and anchoring behavior on plain-text inputs.
On SWE-bench Verified with K=3, context per call drops 43% for Qwen3-4B and 57% for SWE-Master-4B-RL, with resolve rates of 12.1% and 21.8% versus 14.5% and 27.5% for the uncompressed models. Under a 32K-token limit, the compressed agent resolves 21.1% of a 199-instance subset versus 11.1% for the full-text version, and achieves 1.9 times the throughput in concurrent single-GPU serving. The method reduces cost and latency while preserving most task performance.