arXiv:2610.29443cs.CLOct 2026

Manuscript Offprint

arXiv:2610.29443

DynaWeave: Learning to Adapt through Dynamic Scenario Synthesis

Xuan Yang, Chunxiao Liu, Hongsheng Xin, Hao Xu, Ning Miao

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Large language model (LLM) agents increasingly use tools to complete tasks in stateful environments. However, many training environments remain largely static apart from changes caused by the agent's own actions, whereas external events introduced by other users, services, or sudden contingencies in real environments can invalidate ongoing plans. To address this gap, we introduce DynaWeave, an automated synthesis framework that transforms existing static tasks into verifiable dynamic scenarios. The framework generates exogenous events relevant to each task, covering changes in task requirements, environment state, and external information. It uses directed acyclic graphs (DAGs) to represent dependencies between events and an execution engine to activate them during agent interaction. A dynamic verifier revises only the evaluation checks affected by events that actually occur and retains all other checks. Using DynaWeave, we collect 2,095 verified interaction trajectories across 36 environments and use them for supervised fine-tuning of Qwen3.5 models. Experiments on Gaia2, CostBench, and ToolMaze show that DynaWeave achieves consistent improvements in overall performance across all three evaluated model sizes, increasing the task completion rate on CostBench by 67.34 percentage points and even exceeding the performance of Gemini-3.1-Pro-Preview on ToolMaze. These results support dynamic scenario synthesis as a practical approach to training agents to adapt to changing environments. Our code is available at https://github.com/Miaow-Lab/DynaWeave.

1 INTRODUCTION

Large language models (LLM) are increasingly capable of using tools to complete tasks in external environments beyond the conversation. For example, an agent may search a database, compare available options, and then book a room or issue a refund through a tool. Existing benchmarks provide executable environments such as websites, applications, and tool sandboxes in which agents perform tasks, and automatically assess whether the results satisfy the user's request. (Zhou et al., 2024; Xie et al., 2024; Trivedi et al., 2024; Lu et al., 2025; Yao et al., 2024; Barres et al., 2025). Recent advances in environment synthesis further automate the construction of applications, tasks, and verifiers, expanding the supply of verifiable interactions for agent training and evaluation (Dong et al., 2026; Song et al., 2026; Wang et al., 2026; Froger et al., 2025).

Despite this recent progress, most existing environments rely on an implicit assumption: once a task begins, the environment remains largely unchanged except through the actions of the evaluated agent. In practice, however, real-world environments offer no such guarantee of stability: another user may claim a resource that the agent had previously found available; a service may suddenly become unavailable; or an unexpected contingency may disrupt the original plan. We refer to such changes that affect a task during its execution but are not caused by the evaluated agent as exogenous events. These changes can easily invalidate an otherwise correct plan, making success contingent on the agent's ability to dynamically revise its decisions rather than merely execute them.

Recent benchmarks have demonstrated the importance of evaluating agents under dynamic scenarios. Unlike previous static benchmarks, a dynamic scenario is characterized by the possibility of exogenous events during task execution. Gaia2 (Froger et al., 2026) provides asynchronous environments that evolve independently of the agent; CostBench (Liu et al., 2026) changes tool costs and

1^{1}Department of Data Science, City University of Hong Kong. 2^{2}Hong Kong Institute of AI for Science, City University of Hong Kong. 3^{3}Independent Researcher. 4^{4}Li Auto Inc.

availability during execution, requiring agents to revise their plans; ToolMaze (Zhu et al., 2026) introduces explicit or implicit tool failures that require recovery and replanning; and ClawMark (Meng et al., 2026) incorporates external updates into multi-turn, multi-day workflows. TThese benchmarks highlight the value of evaluating adaptation, but constructing dynamic scenarios and their corresponding verifiers can require substantial manual effort. Producing such scenarios at the scale needed for agent training therefore remains a challenge.

In this work, we propose DynaWeave, a framework that automatically transforms existing static tasks into verifiable dynamic scenarios. Given an executable environment, a task, and its original verifier, DynaWeave identifies possible changes relevant to the task and generates corresponding exogenous events. It filters out events that are invalid, implausible, or have no meaningful effect on the task. The resulting scenarios are configured before evaluation, and events are activated during agent interaction when their conditions are met. The original verifier is adapted to account for events that actually occur while preserving unaffected task requirements. This design combines automatic event generation, reproducible execution, and verification, allowing existing task collections such as EnvScaler (Song et al., 2026) and Agent-World (Dong et al., 2026) to be extended without manually designing dynamic scenarios for each domain.

To evaluate the value of these scenarios for agent training, we use DynaWeave to collect 2,095 verified interaction trajectories and subsequently perform supervised fine-tuning on Qwen3.5 models with 2B, 4B, and 9B parameters. Across all three model sizes, this training consistently improves the overall scores on Gaia2 and ToolMaze, as well as the task completion rate on CostBench. In particular, the Qwen3.5-2B model improves its task completion rate on CostBench from 3.00% to 70.34%, representing a substantial gain of 67.34 percentage points. Furthermore, on ToolMaze, the 9B model achieves a composite score of 32.28 after training, even exceeding the baseline performance of Gemini-3.1-Pro-Preview (32.19). These results strongly indicate that the benefits of training on the generated trajectories generalize well and extend beyond the training environments, effectively improving the models' adaptability to unexpected changes during task execution.

The main contributions of our work are as follows: (1) We propose DynaWeave, a general framework for automatically transforming existing static, executable tool-use tasks into verifiable dynamic variants with exogenous changes occurring during task execution.(2) We construct 2,095 dynamic scenarios across 36 environments from EnvScaler, τ2\tau^{2}-bench, ToolSandbox, and AgentDojo, and collect verified interaction trajectories for supervised fine-tuning. (3) Experiments on three dynamic benchmarks show consistent improvements across three model sizes, demonstrating the value of DynaWeave for training agents to adapt to changes in dynamic environments.

References (22)