arXiv:2609.04148cs.AIcs.CL2026-09

从代码代理轨迹中重建可执行环境,提升训练效率与任务多样性。

Terminal-Universe: Turning Agent Trajectories into Scalable Terminal Environments

论文配图:Terminal-Universe: Turning Agent Trajectories into Scalable Terminal Environments
图 1 · 摘自论文原文
  • 通过回放文件操作还原原始工作区,结合补全代理生成完整环境。
  • 构建37.3万个任务可用环境,单轮和多轮任务性能分别提升11.9和13.8点。
  • 支持跨代码库查询与多轮迭代任务,适合强化学习与推理模型训练。

随着基于终端的代码代理日益普及,海量代理轨迹已积累,但真实可执行环境仍稀缺。然而,后训练阶段的代理实际需要的是可重用的环境:每个环境可拆解为多个可验证任务并提供执行反馈,而轨迹仅是单一静态演示。我们发现,现有轨迹中的工具执行历史揭示了其运行环境的结构与内容,因而可从轨迹本身重建环境。为此,我们提出Terminal-Universe框架,将每条轨迹转化为可复用环境,并在此基础上合成新任务与持续交互。具体而言,该框架回放轨迹中的文件操作以恢复修改前的工作区(部分),再由补全代理补充缺失文件与依赖。在恢复的工作区上,我们既重构原始任务,也生成全新任务。此外,我们沿两个互补维度扩展任务:广度上,挖掘相关环境间的依赖关系,合成跨代码库的查询任务;深度上,将初始单轮查询扩展为多轮会话,模拟用户反馈与需求迭代。应用于公开终端代理轨迹,Terminal-Universe生成37.3k个任务充分的环境。在该语料上对Qwen3.5-27B进行监督微调,使其在Terminal-Bench 2.1上的单轮任务性能提升11.9点,在EvoCode-Bench v2 MT@4的多轮任务性能提升13.8点。

原文摘要 · Abstract (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.

环境重建代码代理任务合成多轮交互

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。