cs.CLMar 29, 2026

AgentSwing: Adaptive Parallel Context Management Routing for Long-Horizon Web Agents

Authors: Zhaopeng Feng, Liangcai Su, Zhen Zhang, Xinyu Wang, Xiaotian Zhang, Xiaobin Wang, Runnan Fang, Qi Zhang, 

Organizations: Tongyi Lab, Alibaba Group

Abstract

As large language models (LLMs) evolve into autonomous agents for long-horizon information-seeking, managing finite context capacity has become a critical bottleneck. Existing context management methods typically commit to a single fixed strategy throughout the entire trajectory. Such static designs may work well in some states, but they cannot adapt as the usefulness and reliability of the accumulated context evolve during long-horizon search. To formalize this challenge, we introduce a probabilistic framework that characterizes long-horizon success through two complementary dimensions: search efficiency and terminal precision. Building on this perspective, we propose AgentSwing, a state-aware adaptive parallel context management routing framework. At each trigger point, AgentSwing expands multiple context-managed branches in parallel and uses lookahead routing to select the most promising continuation. Experiments across diverse benchmarks and agent backbones show that AgentSwing consistently outperforms strong static context management methods, often matching or exceeding their performance with up to 3×3\times fewer interaction turns while also improving the ultimate performance ceiling of long-horizon web agents. Beyond the empirical gains, the proposed probabilistic framework provides a principled lens for analyzing and designing future context management strategies for long-horizon agents.

Figures & tables

Appendix figures & tables8 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. LongSeeker: Elastic Context Orchestration for Long-Horizon Search Agents

    May 6, 2026Yijun Lu, Rui Ye, Yuwen Du +3Web Search AgentsTool-Using Agents

  2. Learning Agent-Compatible Context Management for Long-Horizon Tasks

    May 29, 2026Lu Yi, Runlin Lei, Liuyi Yao +6Long-Horizon Agent TasksLLM Context Management

  3. Beyond Skill Evolution: Self-Evolving Context Management Policies for Long-Horizon Agent Harnesses

    Sep 28, 2026Weiyuan Li, Jinghan Xu, Aili Chen +4Agent Harness OptimizationLong-Horizon Agent Tasks