Training agentic models for terminal-based tasks critically depends on high-quality terminal trajectories that capture realistic long-horizon interactions across diverse domains. However, constructing such data at scale remains challenging due to two key requirements: \textbf{\emph{Executability}}, since each instance requires a suitable and often distinct Docker environment; and \textbf{\emph{Verifiability}}, because heterogeneous task outputs preclude unified, standardized verification. To address these challenges, we propose \textbf{TerminalTraj}, a scalable pipeline that (i) filters high-quality repositories to construct Dockerized execution environments, (ii) generates Docker-aligned task instances, and (iii) synthesizes agent trajectories with executable validation code. Using TerminalTraj, we curate 32K Docker images and generate 50,733 verified terminal trajectories across eight domains. Models trained on this data with the Qwen2.5-Coder backbone achieve consistent performance improvements on TerminalBench (TB), with gains of up to 20\% on TB~1.0 and 10\% on TB~2.0 over their respective backbones. Notably, \textbf{TerminalTraj-32B} achieves strong performance among models with fewer than 100B parameters, reaching 35.30\% on TB~1.0 and 22.00\% on TB~2.0, and demonstrates improved test-time scaling behavior. All code and data are available at https://github.com/Wusiwei0410/TerminalTraj.
翻译:训练面向终端任务的智能体模型,关键在于获取能够捕捉跨领域真实长程交互的高质量终端轨迹。然而,大规模构建此类数据仍面临两大核心挑战:**可执行性**,因为每个实例都需要一个合适且通常各异的Docker环境;以及**可验证性**,因为异构的任务输出难以进行统一、标准化的验证。为应对这些挑战,我们提出了**TerminalTraj**,一个可扩展的流水线,它能够(i)筛选高质量代码仓库以构建Docker化执行环境,(ii)生成与Docker环境对齐的任务实例,以及(iii)合成附带可执行验证代码的智能体轨迹。利用TerminalTraj,我们整理了32K个Docker镜像,并在八个领域生成了50,733条经过验证的终端轨迹。基于Qwen2.5-Coder主干模型、使用此数据进行训练的模型,在TerminalBench (TB) 上取得了持续的性能提升,相较于各自的主干模型,在TB~1.0上提升高达20%,在TB~2.0上提升10%。值得注意的是,**TerminalTraj-32B**模型在参数量少于100B的模型中表现优异,在TB~1.0上达到35.30%,在TB~2.0上达到22.00%,并展现出改进的测试时缩放行为。所有代码和数据均可在 https://github.com/Wusiwei0410/TerminalTraj 获取。