Manuscript Offprint

arXiv:2610.13166

Scaling Agentic Data for Long-Horizon Terminal Intelligence

Shun Zou, Ziyu Ma, Yi Zou, Yong Wang, Lin Chen, Zehui Chen, Guanhua Chen, Xiangxiang Chu, Feng Zhao

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

ABSTRACT

Terminal agents are moving beyond local operations toward completing real-world professional tasks. Short trajectories can demonstrate commands and tool calls, but they do not fully show how agents accumulate evidence through exploration, use it to inform judgments, continually adjust strategies based on feedback, and turn intermediate results into final deliverables. High-quality long-horizon trajectories capture these agentic behavioral patterns and their connections within a single problem-solving process, providing richer experience for sustained autonomous work. However, environment synthesis may complete or simplify the key work underlying these patterns in advance and thus remove the need for exploration, implementation, and verification that the agent was meant to perform. To address this, we introduce TerminalHorizon, a fully automated data synthesis engine for long-horizon terminal agents. Starting from real-world professional work, it uses independent execution to identify key work omitted during construction and uses the resulting evidence to guide environment reconstruction. To extend these patterns across stages, it progressively expands tasks under the same goal, introducing new requirements that build on prior results and call for further exploration and improvement. Using this engine, we construct 1.5K task environments and perform supervised fine-tuning of Qwen3.5-27B on the resulting dataset to obtain TerminalHorizon-27B. We achieve substantial performance gains on all 12 benchmarks spanning coding-agent tasks, agentic tasks in real-world production settings, and general reasoning. Multiple RSI case studies, each with a 12-hour research budget, further demonstrate the model's ability to continue experimenting beyond an initial solution, improve its methods based on feedback, and retain effective improvements in its final deliverables.

1 INTRODUCTION

LLM agents are moving beyond answering questions in dialogue toward autonomous work in digital environments (Xu et al., 2026; Koh et al., 2026; Dong et al., 2026b; Zheng et al., 2026). The terminal provides a general interface for this work by bringing code, data, tools, and execution feedback into a shared workspace (Merrill et al., 2026), enabling agents to tackle complex tasks in software development, system administration, and scientific computing (Anthropic, 2025; OpenAI, 2025). As their scope expands from individual operations to long-horizon tasks (Dong et al., 2026b; Ma et al., 2026; Qwen Team, 2026; Ye et al., 2025), agents need to coordinate interdependent stages and adapt to execution feedback to complete these tasks reliably (Deng et al., 2025; Li et al., 2026b; Desai et al., 2026; Yang et al., 2026a). Developing these capabilities requires rich interaction experience during training, but high-quality terminal training data remains scarce.

Recent work on terminal environment synthesis constructs executable and verifiable tasks at scale through skill composition, task generation grounded in technical evidence, and recursive expansion,

∗^{*}Equal contribution. Work done during internship at AMAP, Alibaba Group.

†^{\dagger}Project lead. ‡^{\ddagger}Corresponding authors.

Figure

Figure 1: Motivation for TerminalHorizon. Short trajectories can teach agents to perform terminal operations, but not to autonomously complete complex, long-horizon tasks. Our long-horizon trajectories connect agentic behavioral patterns, such as exploration, strategy revision, and verification, into a complete autonomous problem-solving process.

allowing agents to gain interaction experience through execution and feedback (Wu et al., 2026a; Cheng et al., 2026; Li et al., 2026a; Wu et al., 2026b; Fan et al., 2026). These methods expand task coverage, but their trajectories remain relatively short on average as shown in Figure 4, offering limited experience in sustained problem solving. Short trajectories can capture useful agentic behavioral patterns over a few steps, but the same patterns can extend across multiple stages or even an entire trajectory in long-horizon tasks. For example, agents may repeatedly revise their plans as evidence accumulates, build on intermediate results through a sequence of dependent steps, and revisit earlier work when later verification reveals problems that require further diagnosis and correction. This motivates our focus on high-quality long-horizon trajectories that capture these longer agentic behavioral patterns and show how they work together to complete a task (Section 3).

However, synthesizing these long-horizon trajectories presents two challenges. (i) Complex tasks do not necessarily lead to the intended agentic behavioral patterns. A task may require agents to investigate a problem, develop a solution, and verify it, yet supplied materials may already solve parts of the problem, allowing agents to skip exploration or implementation. These gaps can prevent the intended patterns from fully developing in the collected trajectories. (ii) Even when these patterns appear, long-horizon training data should also capture how they unfold over longer problem-solving processes and connect across stages. More difficult tasks or more interaction turns do not necessarily extend these patterns or strengthen their connections. The challenge is to identify and implement new requirements that go beyond what the original solution can achieve, while keeping the same goal. The added work needs to build on earlier judgments, actions, and results, so that these patterns continue to develop as the task progresses.

To this end, we introduce TerminalHorizon, a fully automated data synthesis engine with two stages: Challenge-Guided Long-Horizon Synthesis and Progressive Horizon Expansion. The first stage converts real-world professional problems into executable tasks and uses an agent uninvolved in their construction to solve them. Analysis of the resulting trajectories checks whether the intended agentic behavioral patterns occur and identifies where task construction has simplified or already completed the analysis, implementation, or verification expected of the agent. These findings guide environment reconstruction so that the agent must perform this work during execution. The second stage expands the original task under the same goal, introducing requirements that call for further analysis, implementation, and verification. It makes this added work depend on earlier results and execution feedback, allowing the intended patterns to extend across stages. Together, these stages support the generation of long-horizon trajectories in which the intended agentic behavioral patterns emerge and extend across stages toward task completion.

Using TerminalHorizon, we construct 1,535 task environments and collect 2,852 training trajectories to form TerminalHorizon-3K. The trajectories average 52.8 interaction turns, substantially longer than those from the methods compared in Figure 4. Supervised Fine-tuning Qwen3.5-27B on these 2,852 trajectories yields TerminalHorizon-27B, which improves over the base model by 14.2% and 13.85% on Terminal-Bench 2.0 and 2.1, respectively. These gains extend to real-world productivity tasks, with improvements of 11.7% in Pass Rate and 23.3% in Partial score on AutomationBench, and 11.3% on VitaBench. Furthermore, case studies on multiple long-horizon recursive self-improvement

(RSI) tasks, each with a 12-hour research budget, show how the model continues experimenting beyond an initial solution, refines its methods based on feedback, and incorporates these improvements into final deliverables. Our main contributions are as follows:

• We propose a perspective on high-quality long-horizon terminal data centered on agentic patterns and their connections across stages, emphasizing the substantive work that environments must preserve to elicit them.

• We introduce TerminalHorizon, a fully automated data synthesis engine that combines challenge-guided construction with progressive expansion to build TerminalHorizon-3K, comprising 1,535 task environments and 2,852 training trajectories.

• Supervised Fine-tuning on only about 3K trajectories improves performance across 12 benchmarks spanning coding, real-world productivity, and general reasoning, while multiple 12-hour RSI case studies demonstrate continued experimentation, improvement, and final delivery.

References (100)

Couldn't load all references. Reload the page to try again.