Terminal-Universe:将智能体轨迹转化为可扩展的终端环境
Terminal-Universe: Turning Agent Trajectories into Scalable Terminal Environments
September 3, 2026
作者: Jie Wu, Zhenru Zhang, Beichen Zhang, Xuwu Wang, Yuhui Su, Mouxiang Chen, Peng Wang, Zhihai Wang, Que Shen, Hao Zhou, An Yang, Fei Huang, Yujiu Yang, Dayiheng Liu
cs.AI
摘要
随着基于终端的代码智能体日益普及,智能体轨迹已大规模积累,而真实、可执行的环境仍然稀缺。然而,环境才是智能体后训练真正需要的数据:每个环境都可以被反复查询以生成多种可验证任务,并提供执行反馈;相比之下,一条轨迹只是一份冻结的演示样本。与其从零开始生成环境,我们观察到,现有轨迹中的工具执行历史能够揭示其运行环境的结构与内容,从而使从轨迹自身重建这些环境成为可能。为此,我们提出了Terminal-Universe——一个将每条轨迹转化为可复用环境,并对其进行探索以合成新任务和实现持续交互的框架。具体而言,Terminal-Universe重放轨迹中记录的文件操作,将每个被智能体修改过的文件恢复到修改之前的状态,得到一个部分还原的工作区;随后,补全智能体负责补充缺失的文件和依赖。在这个恢复出的工作区上,我们既重建原始意图对应的任务,也合成全新的任务。此外,我们还沿着两个互补的维度——广度与深度——扩展任务。在广度方面,我们挖掘相关环境之间的有向依赖关系,合成跨越多个代码库的跨工作区查询,正如开发者在真实开发中经常做的那样。在深度方面,我们借助用户智能体,将初始的单轮查询扩展为多轮会话,以捕捉迭代式的用户反馈与需求细化过程。将Terminal-Universe应用于公开的终端智能体轨迹后,我们生成了3.73万个足以支撑任务的环境。在此语料库上对Qwen3.5-27B进行监督微调,使其在Terminal-Bench 2.1上的单轮性能提升了11.9个百分点,在EvoCode-Bench v2上的多轮性能(MT@4)提升了13.8个百分点。
English
As terminal-based code agents become prevalent, agent trajectories have accumulated at scale, while realistic, executable environments remain scarce. However, environments are what agent post-training actually requires: each can be re-queried into many verifiable tasks and provides execution feedback, whereas a trajectory is a single frozen demonstration. Rather than generating environments from scratch, we observe that the tool-execution history in existing trajectories exposes the structure and contents of the environments in which they ran, making it possible to reconstruct those environments from the trajectories themselves. Thus, we introduce Terminal-Universe, a framework which turns each trajectory into a reusable environment and explores it for synthesizing new tasks and continued interactions. Specifically, Terminal-Universe replays the file operations recorded in a trajectory to restore each file before the agent modified it, yielding a partial workspace; a completion agent then supplies the missing files and dependencies. On this recovered workspace, we both reconstruct the original intent task and synthesize entirely new ones. Besides, we also scale the tasks along two complementary axes: breadth and depth. For breadth, we mine directional dependency relations between related environments and synthesize cross-workspace queries spanning multiple codebases, as developers routinely do in real-world development. For depth, we extend the initial single-turn query into a multi-round session that captures iterative user feedback and requirement refinement via a user agent. Applied to public terminal agent trajectories, Terminal-Universe produces 37.3k task-sufficient environments. Supervised fine-tuning of Qwen3.5-27B on this corpus improves single-round performance on Terminal-Bench 2.1 by 11.9 points and multi-round performance on EvoCode-Bench v2 MT@4 by 13.8 points.