Long‑horizon agents continuously accumulate interaction history during task execution, yet the relevance of past interactions changes as the agent's state evolves. Existing context‑management approaches typically compress history using fixed windows, periodic schedules, or current relevance, overlooking a more fundamental question: when is it safe to replace a past interaction? Premature compression discards information that may still be needed for future decisions, while overly conservative retention incurs large context overhead.
To address this, we introduce StateComp (State‑Conditioned Compression), a framework that decides, based on the current agent state, when historical interactions can be safely compressed. StateComp builds KEEP and READY supervision signals through a two‑stage annotation process and trains an imbalance‑aware router on hidden representations from a frozen language model. A bounded state representation reduces the cost of evaluating long histories; during execution, adjacent READY interactions are grouped into continuous spans and replaced with compact summaries.
Experiments on the WorkBuddyBench benchmark show that StateComp reduces the total number of agent and summarization tokens by 52.27% while preserving task performance, and achieves a 12.67‑fold speedup in representation extraction.
Review