ReTerm: Recovery Training for Self-Improving Terminal Agents
Not on the map. Why?
Abstract (arXiv)
Terminal agents have shown strong abilities in complex coding tasks. However, they often struggle to recover from errors during long-running execution (e.g., command errors, faulty implementations), eventually leading to task failures. To this end, we present ReTerm, a self-improving terminal agent trained by learning how to recover from its own failed terminal tasks. To support its training, we construct a customized data pipeline and produce ReTerm-10K, a high-quality dataset that provides effective recovery demonstrations for SFT cold start. Furthermore, we propose ReTerm-GRPO, an online RL algorithm that forks from the agent's own failure states to generate multiple independent self-recovery attempts. By learning from whether these attempts successfully complete the task, the agent self-improves through its own recovery experience. Built on Qwen3.5-9B, our ReTerm-9B achieves 34.8% Pass@1 on Terminal-Bench 2.0, improving over the base model by 14.6 points. Further analysis shows that our method achieves consistently higher recovery rates across diverse error categories compared with standard GRPO training. All code, data and model are released at https://github.com/twothsnd/ReTerm.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 26 of its 31 references that are in the map. First posted on arXiv 13 Oct 2026.
Builds on
26 of 31 references.
References · 26
- 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,276
- 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,442
- 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineeringcited by 1,737
- 2026DeepSeek-V4: Towards Highly Efficient Million-Token Context Intelligencecited by 1,040
- 2024OpenHands: An Open Platform for AI Software Developers as Generalist Agentscited by 1,002
- 2026Terminal-Bench: Benchmarking Agents on Hard, Realistic Tasks in Command Line Interfacescited by 585
- 2025Video-R1: Reinforcing Video Reasoning in MLLMscited by 484
- 2024Training Language Models to Self-Correct via Reinforcement Learningcited by 426
- 2025SWE-smith: Scaling Data for Software Engineering Agentscited by 285
- 2025R2E-Gym: Procedural Environments and Hybrid Verifiers for Scaling Open-Weights SWE Agentscited by 158
- 2024SpreadsheetBench: Towards Challenging Real World Spreadsheet Manipulationcited by 111
- 2025Critique-GRPO: Advancing LLM Reasoning with Natural Language and Numerical Feedbackcited by 90
14 more
- 2025Agent-R: Training Language Model Agents to Reflect via Iterative Self-Trainingcited by 82
- 2026Endless Terminals: Scaling RL Environments for Terminal Agentscited by 54
- 2025SkyRL-Agent: Efficient RL Training for Multi-turn LLM Agentcited by 48
- 2026On Data Engineering for Scaling LLM Terminal Capabilitiescited by 43
- 2026LongCLI-Bench: A Preliminary Benchmark and Study for Long-horizon Agentic Programming in Command-Line Interfacescited by 34
- 2026Tmax: A simple recipe for terminal agentscited by 33
- 2026TermiGen: High-Fidelity Environment and Robust Trajectory Synthesis for Terminal Agentscited by 29
- 2026ECHO: Terminal Agents Learn World Models for Freecited by 19
- 2026Recursive Synthesis for Long-Horizon Terminal Taskscited by 19
- 2026Exploring Reasoning Reward Model for Agentscited by 15
- 2026SETA: Scaling Environments for Terminal Agentscited by 12
- 2026OpenThoughts-Agent: Data Recipes for Agentic Modelscited by 11
- 2026FACET: Preserving Source Intent and Executable State in Terminal Task Synthesiscited by 9
- 2026T1: Terminal Agent Reinforcement Learning for Long-Horizon Taskscited by 7
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026Agent Error Dataset: Scaling 50,000 Error--Diagnosis Pairs for Failure Analysis and Error-Aware Post-Training
- 2025ReflexGrad: Within-Episode Failure Recovery in LLM Agents via Progress-Gated Dual-Process Routing
- 2026Diagnosis Before Recovery: Turning Agent Failures into Selective Self-Correction
- 2026FC-SWE: Failure-Conditioned RL for Long-Horizon Software Engineering Agents
- 2026AgentRewind: Recoverable Execution for Long-Horizon LLM Agents
- 2026ExecCritic: Learn to Test, Test to Improve for Coding Agents
- 2026Learning from Failure: Inference-Time Self-Improvement for Computer-Use Agents
- 2026FailForge: Distilling Procedural Competence from Persistent Failures into Code Agents