May 28, 2026
Mastering terminal environments requires language agents capable of multi-step planning, feedback-grounded execution, and dynamic state adaptation. However, training such agents is currently bottlenecked by a reliance on scraped external repositories,
which limits domain diversity, environment controllability, and the targeting of specific capability deficits. We introduce LiteCoder-Terminal-Gen, a zero-dependency synthesis pipeline that autonomously generates executable and verifiable
terminal training environments directly from domain specifications. Using this framework, we construct two large-scale resources: LiteCoder-Terminal-SFT, comprising 11,255 expert trajectories across 10 domains, and
LiteCoder-Terminal-RL, featuring 602 verifiable environments for trajectory-level preference optimization. Supervised fine-tuning of Qwen-family models on our SFT dataset yields agents that significantly outperform their base counterparts.
Notably, our 32B variant achieves 29.06%, 18.54%, and 34.00% pass@1 on Terminal Bench 1.0, 2.0, and Pro, respectively. Furthermore, applying Direct Multi-turn Preference Optimization (DMPO) on our RL environments yields additional performance gains. These
results systematically demonstrate that fully synthetic, executable environments offer a scalable and verifiable supervision signal for mastering complex, real-world command-line workflows.
Models & Datasets:https://huggingface.co/Lite-Coder/
Recent advancements [1]–[3] have empowered Large Language Models (LLMs) to transition from conversational assistants [4], [5] into autonomous agents capable of interacting dynamically with complex digital environments [6]–[8]. Among these environments, the Command-Line Interface (CLI) represents the most general-purpose and foundational interface for digital interaction.
Driven by this shift, the community urgently requires scalable methods to generate diverse terminal environments for both learning and evaluating. Unlike the patch generation tasks evaluated in SWE-bench [9], terminal-based tasks—as pioneered by Terminal Bench [10]—situate agents in a partially observable environment that necessitates a robust capacity to manage complex system changes, demanding both dynamic environment adaptation and persistent goal orientation across long-horizon interactions.
In response to this urgent demand, we introduce LiteCoder-Terminal-Gen, a zero-dependency terminal environment synthesis framework. LiteCoder-Terminal-Gen features an end-to-end pipeline to construct diverse terminal environments and expert demonstrations entirely from scratch. Specifically, the synthesis process operates through three core stages: (1) given a target skill definition detailing an area where the model requires improvement, the framework autonomously generates a massive scale of expert-level task drafts; (2) from these vast propositions, it dynamically instantiates the appropriate underlying terminal environments required for task execution; and (3) grounded in these established tasks and environments, it automatically constructs robust test cases to provide fine-grained scoring criteria.
Crucially, this zero-dependency architecture represents a fundamental departure from existing synthesis pipelines. It eliminates the labor-intensive process of scraping, filtering, and curating high-quality issues from massive external sources like GitHub or Stack Overflow. By breaking free from the constraints of human-curated data repositories, LiteCoder-Terminal-Gen enables a highly targeted training paradigm: it can actively generate specific training environments and trajectories on-demand to directly address and overcome an agent’s identified capability deficits.
Starting from these synthesized tasks, we build LiteCoder-Terminal-SFT, a collection of 11,255 expert trajectories generated with capable teacher models like MiniMax models, and fine-tune three Qwen-family base models from 4B to 32B scales.
The resulting LiteCoder-Terminal models demonstrate strong proficiency in complex, long-horizon system operations across model scales. In particular, our best-performing 32B model achieves 29.06%, 18.54%, and 34.00% pass@1 on Terminal Bench
1.0, Terminal Bench 2.0, and Terminal Bench Pro, respectively, while smaller variants also consistently improve over their corresponding base models. Additionally, we build LiteCoder-Terminal-RL, a collection of 602 executable terminal
environments materialized with LiteCoder-Terminal-Gen, to support verifier-grounded rollouts and trajectory-level preference optimization. Applying DMPO on LiteCoder-Terminal-RL further improves the 4B SFT model on Terminal Bench
2.0 and Terminal Bench Pro, showing that synthesized executable environments can provide useful preference-learning signals beyond supervised fine-tuning.
The contributions of this paper can be summarized as:
We introduce LiteCoder-Terminal-Gen, a zero-dependency synthesis framework that autonomously generates tailored terminal environments, tasks, and robust scoring oracles from scratch to systematically address specific agent capability
deficits.
We open-source the LiteCoder-Terminal agent alongside the LiteCoder-Terminal-SFT dataset with 11,255 expert interaction trajectories and the LiteCoder-Terminal-RL dataset with 602 executable and verifiable
terminal environments, providing the community with a critical, large-scale resource to overcome the scarcity of system-level training data.
We demonstrate that training on our synthesized data improves terminal-agent performance across Terminal Bench 1.0, Terminal Bench 2.0, and Terminal Bench Pro; supervised fine-tuning yields strong gains across model scales, while DMPO on
LiteCoder-Terminal-RL provides further improvements for the 4B SFT model on the harder Terminal Bench 2.0 and Pro benchmarks.
Despite the significant progress frontier models have achieved on repository-level software engineering tasks [11], mastering the terminal beyond pure code maintenance remains an open challenge, because these tasks require agents to manage latent system states and interpret raw textual feedback over lengthy context windows. While recent benchmarks like Terminal-Bench [10] have established rigorous evaluation protocols, the field lacks a scalable method to generate diverse, execution-ready training environments. We also note that throughout the iteration cycle and multiple open-source releases of our dataset1, several high-value data resources have emerged within the field, including the concurrent works by [12], [13] and [14]. It is precisely these efforts that have driven the collective advancement of the open-source community.
Large-scale agentic training has become a central theme in recent frontier models [15]–[17]. However, the methodologies employed by even the most prominent "open-source" models remain largely opaque; the core training data and recipes lack public implementations. While some existing works [18] have released subsets of agentic data, they generally lack coverage of terminal-task scenarios. Concurrently, recent efforts such as OpenThoughts-Agent [19] have attempted to bridge the training gap by converting existing datasets like NL2Bash and InferredBugs into interactive formats. However, these tasks are primarily focused on short-sequence command generation or isolated bug-fixing, which may lack the latent long-horizon supervision signals necessary for complex system manipulation.
To overcome the scarcity of environment-grounded training data, we introduce LiteCoder-Terminal-Gen, a zero-dependency synthesis pipeline designed to construct executable and verifiable terminal task environments from scratch. Given a
high-level domain specification, the framework autonomously generates candidate tasks and materializes them into fully interactive environments.
We begin by specifying a set of terminal domains that cover a broad range of terminal tasks, including AI&ML, build tools, data science, networking, security,
system administration, version control, coding, scientific computing, and games. We then generate tasks conditioned on each domain using a Magpie-like [20] LLM sampling strategy, as illustrated in Figure 1. Instead of relying on existing user queries or reference web
resources (e.g., GitHub / Stack Overflow), we design domain-specific system prompts to steer task synthesis toward each target domain.
Specifically, we leverage the autoregressive nature of aligned LLMs by completing a partial conversation context. We directly concatenate a pre-query template identifier (e.g., \(\texttt{<user\_start>}\)) to this system prompt, without supplying any actual user input. This trailing identifier effectively prompts the model into the role of the user, generating the missing turn. By controlling the system prompt, we steer the model to synthesize a specific, high-quality task query that aligns with the target domain. This is immediately followed by a feasibility check that retains only tasks satisfying a set of criteria, including moderate complexity, a clear task description, and available resources.
Although the raw task descriptions sampled from the previous step are semantically rich, they are not directly executable. While they effectively capture the user’s intent, they often lack the concrete file layouts, background artifacts, expected
outputs, and verifiable success criteria essential for an interactive terminal environment. To turn such descriptions into training environments, LiteCoder-Terminal-Gen synthesizes each task through a five-stage sequential pipeline, as
illustrated in Figure 2. The pipeline progressively refines the task, initializes the environment, synthesizes a reference solution, constructs a verifier, and derives the final configuration. Crucially, each generation
stage is explicitly conditioned on the cumulative execution trace of all prior steps. This sequential grounding ensures causal consistency throughout the synthesis process, preventing logical errors—such as a verifier evaluating non-existent artifacts.
We adopt the Harbor task format [21] as our unified interface for specifying executable tasks and collecting agent trajectories. Each task is organized as a self-contained directory with five key components: (1) an instruction file detailing the natural-language goal; (2) an environment setup, typically a Dockerfile and input artifacts; (3) a reference solution to validate the task design; (4) test scripts that evaluate the agent’s success and record rewards; and (5) a configuration file specifying metadata and execution resource limits.
The Refiner Agent takes the raw task description produced by the domain-to-task generation stage and rewrites it into a testable specification. Two constraints are enforced: (i) all input and output files must be bound to concrete absolute
paths under the fixed working directory /app (e.g., /app/input.json, /app/output.csv), removing ambiguity that downstream verifiers cannot recover from; (ii) output formats are specified using deterministic schemas
(e.g., JSON keys, CSV columns, and floating-point precision). The agent is explicitly prompted to not leak any solution hints, implementation strategies, or related test cases into the final instruction.
Given the refined instruction, the Environment Agent produces the environment/ directory containing (a) a Dockerfile and (b) all input artifacts referenced by the instruction. Rather than authoring a Dockerfile from
scratch, the agent extends a base template supplied by the pipeline. The template pins Ubuntu 24.04 as the base OS and pre-installs the necessary runtime dependencies. The prompts are tuned to ensure that the prepared dependencies do not
trivially simplify the task.
The Solver Agent is tasked with producing a complete, executable solution/solve.sh that satisfies every constraint in instruction.md. The resulting artifact plays two roles. First, it acts as a constructive solvability
check: the existence of a runnable solve.sh certifies that the task is actually achievable by an agent; second, it provides a reference point for checking whether the Stage 4 verifier behaves as intended.
The Verifier Agent generates two files. The first, tests/test.sh, is mostly template code that serves as the verifier’s entry point and writes a binary reward to /logs/verifier/reward.txt. The second,
tests/test_outputs.py, contains the actual test logic as a pytest suite. Because this suite is generated after the oracle solution, it can easily overfit to that specific implementation and reject other valid solutions. To ensure the quality
of the verifier (rejecting lazy solutions while accepting legitimate variants), we prompt the agent to execute a mandatory four-phase adversarial iteration before finalizing each assertion:
Draft: Write an initial validation check based on the task specification.
Attack: Simulate a lazy student that emits an empty file, incorrect data, or a hardcoded dummy payload. If any of these pass, the assertion is too weak.
Refine: Simulate an expert agent that uses a different implementation strategy while still satisfying the task specification. If the assertion false-rejects, it is over-specified.
Finalize: Write the final robust version based on the preceding attack and refinement steps.
The final Config Agent reads all four upstream artifacts and emits task.toml, which declares the verifier, agent, and build timeouts, CPU, memory, and storage quotas needed by the task. Resource requirements are estimated by
jointly considering the generated artifacts from earlier stages.
Each stage terminates in a lightweight existence check for its expected outputs (instruction.md, environment/Dockerfile, solution/solve.sh, at least one tests/test*.{py,sh}, and
task.toml). Any stage that fails this check triggers a retry mechanism.
To create the SFT dataset, we collect trajectories with Harbor using MiniMax M2 [22] and M2.1 [23] as teacher models across multiple agent scaffolds, including Terminus2, Claude Code [3], and OpenHands [24]. Each run produces a terminal interaction trajectory containing the agent’s reasoning, command actions, and environment observations, thereby capturing the thought-action-observation loops required for long-horizon terminal problem solving.
Quality control is critical for synthetic data. We employ an LLM judge to rigorously filter trajectories based on four behavioral dimensions, retaining only those that demonstrate robust task-solving behavior:
Adaptability: We check if the agent can change its plan when it hits an error. We remove trajectories where the agent gets stuck in a loop (repeating the exact same command) or just makes tiny syntax tweaks without changing its overall approach. A good trajectory shows the agent understanding the cause of the error and switching to a new tool or strategy.
Groundedness: We make sure the agent pays attention to actual results rather than making things up. We drop trajectories if the agent ignores error messages, assumes it succeeded without actually verifying, or forgets the mistakes it just made.
Persistence: We want to see the agent keep trying. We filter out examples where the agent gives up right away when it faces a problem (like a "command not found" error), rather than looking for a reasonable workaround.
Explicit Refusal: We simply exclude any trajectories where the agent flat-out refuses to do the task, ensuring our final dataset remains helpful and cooperative.
We perform strict \(N\)-gram overlap filtering between our generated task instructions and the test queries in the evaluation benchmarks. Following common practices [25], [26], we extract all 13-grams from the Terminal Bench datasets and
filter out any potentially overlapping tasks. We refer to the remaining decontaminated dataset as LiteCoder-Terminal-SFT.
The LiteCoder-Terminal-SFT dataset comprises 11,255 expert trajectories spanning 10 task categories, with an average of 27.4 turns per trajectory. Figure 3 shows the category distribution. Task categories are roughly balanced, with system administration (11.6%), networking (11.6%), and build tools (12.0%) being the largest groups, while scientific computing (7.3%) is the
smallest. The dataset incorporates trajectories from three agent scaffolds: Terminus-2 (86.6%), OpenHands (7.1%), and Claude Code (6.3%).
To assess whether LiteCoder-Terminal-Gen produces tasks that elicit broad and realistic terminal behavior, we analyze the commands actually executed in the collected expert trajectories. We tokenize the first command of every keystroke
entry across all 11,255 expert trajectories and intersect the resulting vocabulary with the tldr-pages curated Linux command index. After this filter, the trajectories invoke over 720 distinct real Linux commands, spanning from very
commonly used utilities—file inspection (cat, ls, head, tail, wc, find, grep), source control (git), package management (apt,
apt-get, dpkg, pip, cargo), build and language toolchains (make, gcc, go, python3), system administration (chmod, ps,
systemctl, ufw, su), networking and security (curl, wget, openssl, gpg, nginx)—all the way to rare specialist tools such as mongod,
kubeadm, grafana-cli, bison, nasm, and lvcreate. The 20 most frequently invoked commands are shown in Figure 3. This broad command usage demonstrates that
our domain-driven sampling captures a wide variety of practical terminal tasks, rather than just standard coding workflows.
We evaluate LiteCoder-Terminal-Gen through two complementary training paradigms. First, supervised fine-tuning (SFT) on LiteCoder-Terminal-SFT validates trajectory quality. Second, we use Direct Multi-turn Preference
Optimization (DMPO) [27] on LiteCoder-Terminal-RL to evaluate the reliability of our synthesized verifiers. Applying standard DPO to
multi-turn interactions is mathematically suboptimal because it treats the sequence as a single-step bandit problem, which ignores the changing environmental states. DMPO addresses this flaw by incorporating a discounted state-action occupancy measure. The
objective of DMPO is:
\[\mathcal{L}_{\text{DMPO}} = - \mathbb{E}_{(\tau_w, \tau_l) \sim \mathcal{D}} \left[ \log \sigma \left( \beta \sum_{t=1}^{|\tau_w|} \alpha_{t}^{(w)} \log \frac{\pi_\theta(a_t^w|s_t^w)}{\pi_{\text{ref}}(a_t^w|s_t^w)} - \beta \sum_{t=1}^{|\tau_l|} \alpha_{t}^{(l)} \log \frac{\pi_\theta(a_t^l|s_t^l)}{\pi_{\text{ref}}(a_t^l|s_t^l)} \right) \right]\]
where \(s_t\) and \(a_t\) represent the state and action sequences at turn \(t\). The weight \(\alpha_t\) is the normalized discount factor for a trajectory of length \(T\): \(\alpha_t = \frac{\gamma^{t-1}(1 - \gamma^{T-t+1})}{1 - \gamma^T}\). Applying DMPO serves as a rigorous evaluation of the verifiers themselves. If this training improves model performance, it demonstrates that the auto-generated environments provide valid reward signals capable of guiding long-horizon optimization.
To perform DMPO, we construct trajectory-level preference pairs using our synthesized environments. Starting from the LiteCoder-Terminal-4b-sft checkpoint, we sample two independent rollouts for each of the 602 environments in
LiteCoder-Terminal-RL. We compute a pass ratio (the fraction of verifier checks satisfied) for each rollout and retain only the environments where the two trajectories yield divergent scores. The higher-scoring trajectory serves as the preferred multi-turn
response, while a lower-scoring trajectory from the same environment is selected as the rejected response.
We evaluate our models on Terminal Bench 1.03, Terminal Bench 2.0 [10], and Terminal Bench Pro [28], reporting the Pass Rate (%) as the primary metric for model capability. To mitigate variance and obtain robust estimates, the scores for Terminal Bench 1.0 and 2.0 are averaged across four independent runs. Additionally, we report the pass@4 metric. While we deploy Terminus-2 as our default agentic scaffold, we evaluate the Nex-N1 baseline using OpenHands to align with its original technical report and ensure a fair comparison.
Our empirical study leverages representative instruction-tuned backbones: Qwen3-{4B/30B-A3B}-Instruct [29], and
Qwen2.5-Coder-32B-Instruct [30]. We fine-tune each base model on our proposed corpus, yielding the LiteCoder-Terminal
models. Comprehensive training details and hyperparameters are deferred to Appendix 11. Furthermore, we include representative SFT baselines, such as Qwen3-30B-A3B-Nex-N1 [18] and OpenThinker-Agent-v1 [19].
4pt
@ l l c c c c c c c @ & & &
(lr)3-6 (lr)7-9 & & TB-1 & TB-2 & TB-Pro & Avg. & TB-1 & TB-2 & Avg.
Qwen3-4B-Instruct [29] & Terminus-2 & \(6.25_{\pm 1.77}\) & \(1.12_{\pm
1.12}\) & 3.50 & 3.62 & 15.00 & 3.37 & 9.19
Qwen3-30B-A3B-Instruct [29] & Terminus-2 & \(16.56_{\pm 3.29}\) & \(5.34_{\pm 1.69}\) & 20.50 & 14.13 & 28.75 & 11.24 & 20.00
Qwen2.5-Coder-32B-Instruct [30] & Terminus-2 & \(12.19_{\pm 3.08}\) & \(4.49_{\pm 1.72}\) & 13.50 & 10.06 & 20.00 & 8.99 & 14.50
OpenThinker-Agent-v1 [19] & Terminus-2 & \(11.25_{\pm 1.77}\) & \(4.49_{\pm 3.18}\) & 19.50 & 11.75 & 25.00 & 10.10 & 17.55
Qwen3-30B-A3B-Nex-N1 [18] & OpenHands & \(18.44_{\pm 3.13}\) & \(12.36_{\pm
2.05}\) & 21.00 & 17.27 & 32.50 & 23.60 & 28.05
Qwen3-32B-Nex-N1 [18] & OpenHands & \(24.69_{\pm 1.56}\) & \(18.54_{\pm
1.95}\) & 30.50 & 24.58 & 35.00 & 26.97 & 30.99
TerminalTraj-32B [14] & Terminus-2 & \(33.44_{\pm
3.44}\) & \(23.88_{\pm 2.95}\) & 30.50 & 29.27 & 45.00 & 37.08 & 41.04
Nemotron-Terminal-32B [12] & Terminus-2 & \(27.81_{\pm 3.29}\) & \(21.35_{\pm
2.75}\) & 37.00 & 28.72 & 46.25 & 35.96 & 41.11
LiteCoder-Terminal-4b-sft & Terminus-2 & \(14.69_{\pm 1.20}\) & \(4.78_{\pm 1.83}\) & 21.50 & 13.66 & 28.75 & 10.11 & 19.43
LiteCoder-Terminal-30b-a3b-sft & Terminus-2 & \(24.38_{\pm 1.61}\) & \(12.36_{\pm 2.75}\) & 31.50 & 22.75 & 40.00 & 23.60 & 31.80
LiteCoder-Terminal-32b-sft & Terminus-2 & \({29.06}_{\pm 4.18}\) & \({18.54}_{\pm 3.40}\) & 34.00 & 27.20 & 45.00 & 30.34 & 37.67
Table [tab:agentic95benchmark95combined] shows that training on LiteCoder-Terminal-SFT consistently improves
terminal-agent performance across model scales and benchmarks: the fine-tuned LiteCoder-Terminal models outperform their corresponding backbones across all three scales. Specifically, on Terminal Bench 1.0, the 4B, 30B-A3B, and 32B variants
surpass their respective base models by 8.44, 7.82, and 16.87 absolute percentage points. On Terminal Bench 2.0, the improvements are even more pronounced: the 4B and 32B models achieve more than four-fold increases in pass rate, while the 30B-A3B model
more than doubles the performance of its base counterpart. Most notably, on Terminal Bench Pro—which enforces balanced domain distribution—the 32B variant achieves 34.00% pass@1, while the 30B-A3B and 4B variants reach 31.50% and 21.50%, respectively.
These gains indicate that our synthesized expert trajectories provide effective training signals for the command-line skills needed in rigorous terminal benchmarks.
LiteCoder-Terminal achieves competitive performance using a substantially smaller training set than existing baselines, consistently outperforming or matching the corresponding Nex-N1 [18] models at both 30B and 32B scales across Terminal Bench 1.0, 2.0, and Pro. Crucially, these results highlight the efficacy and data efficiency of our synthesis paradigm:
while large-scale datasets like TerminalTraj [14] (50.7K trajectories) and
Nemotron-Terminal [12] (490.5K) rely heavily on mining existing human-curated repositories, LiteCoder-Terminal-Gen
autonomously synthesizes both the executable environments and complex interaction tasks entirely from scratch. Despite utilizing up to 43.6\(\times\) fewer trajectories (11.2K), our 32B model remains highly competitive,
surpassing Nemotron-Terminal on Terminal Bench 1.0, achieving top-tier results on Terminal Bench Pro, and maintaining a narrow gap in average pass@1 performance. Ultimately, this demonstrates that zero-dependency environment synthesis provides
a highly data-efficient supervision signal for enhancing terminal-agent capabilities.
r0.48
6pt
| Method | TB-1 | TB-2 | TB-Pro | Avg. |
|---|---|---|---|---|
| SFT Baseline | 14.69 | 4.78 | 21.50 | 13.66 |
| + DMPO | 14.38 | 6.10 | 23.00 | 14.49 |
As shown in Table 1, applying DMPO improves average performance over the SFT baseline, with gains on the harder Terminal Bench 2.0 and Terminal Bench Pro benchmarks. It increases pass@1 from 4.78% to 6.10% on Terminal Bench 2.0, and from 21.50% to 23.00% on Terminal Bench Pro. This indicates that LiteCoder-Terminal-RL environments are highly coherent; the verifiers provide trustworthy, correctness-grounded optimization targets capable of steering long-horizon agent behavior beyond what is achievable through behavioral cloning alone.
To understand the contribution of individual domains to overall capability, we perform a leave-one-domain-out ablation on our balanced subset. We fine-tune the Qwen3-4B-Instruct base model on reduced mixtures and compare performance against
the full dataset (Table 2). Removing any single domain yields only a modest average degradation, indicating a distributed reliance on diverse task types rather
than a single critical domain. Notably, removing domains like "games" or "security" triggers the sharpest overall declines (\(\downarrow\) 2.50 and \(\downarrow\) 2.15, respectively),
suggesting that these domains present highly challenging scenarios that rigorously test the model’s capacity for edge-case reasoning and complex dependency management—capabilities that transfer broadly across the benchmark suite.
5pt
| Removed Domain | Absolute Performance (%) | Impact | |||
|---|---|---|---|---|---|
| 2-6 | TB-1 | TB-2 | TB-Pro | Avg. | \(\Delta\) Avg. |
| Full Data (Baseline) | 14.69 | 4.78 | 21.50 | 13.66 | - |
| w/o games | 11.88 | 5.60 | 16.00 | 11.16 | |
| w/o security | 11.25 | 4.78 | 18.50 | 11.51 | |
| w/o version control | 12.81 | 3.93 | 19.50 | 12.08 | |
| w/o coding | 13.44 | 5.30 | 17.50 | 12.08 | |
| w/o data science | 13.13 | 6.18 | 17.50 | 12.27 | |
| w/o ai_ml | 10.94 | 5.62 | 20.50 | 12.35 | |
| w/o system admin | 14.06 | 7.86 | 16.00 | 12.64 | |
| w/o networking | 13.75 | 5.90 | 19.50 | 13.05 | |
| w/o build tools | 16.88 | 4.50 | 18.50 | 13.29 | |
| w/o scientific comp. | 14.38 | 4.78 | 21.00 | 13.39 | |
We analyze test-time scaling behavior by tracking pass@\(k\) performance. Models lacking robust terminal-solving capabilities tend to plateau quickly, as repeated attempts merely reproduce identical failure modes.
Figure 4 illustrates that LiteCoder-Terminal models possess a distinctly stronger capacity to exploit increased sampling budgets. On Terminal Bench 1.0, the 30B-A3B variant scales from 24.4% at \(k=1\) to 40.0% at \(k=4\), a 15.6-point gain that outpaces the base model’s trajectory. This steep scaling curve on both TB-1 and TB-2 indicates that SFT on our dataset not only improves the
single-attempt pass rate (pass@1) but fundamentally enhances the agent’s latent capacity to explore and eventually uncover correct execution paths.
To examine whether the learned terminal-agent behaviors carry over to software engineering tasks, we additionally evaluate our trained models on SWE-bench.
Empirical results demonstrate that the terminal interaction capabilities acquired via LiteCoder-Terminal-SFT successfully generalize to SWE-bench. As illustrated in Figure 5, the fine-tuned models
consistently outperform their base counterparts: the resolution rate of the 4B model improves from 1.2% to 5.2%, while the 30B-A3B model exhibits a substantial increase from 5.8% to 13.0%. Although our data pipeline is not explicitly optimized for
SWE-bench, these findings provide evidence that modeling long-horizon terminal trajectories broadly enhances repository-level software engineering workflows within the same scaffold.
In this paper, we introduced LiteCoder-Terminal-Gen, a zero-dependency pipeline for synthesizing executable terminal-agent environments. By replacing source-dependent task mining with target-driven synthesis, our framework ensures accurate and scalable coverage of long-horizon command-line skills. Models fine-tuned on our synthesized SFT trajectories consistently outperform their backbones across the Terminal Bench suite, while applying DMPO on our verifier-grounded RL environments unlocks further performance gains on highly complex tasks. These results systematically demonstrate that fully synthetic, executable environments offer a scalable supervision signal for mastering real-world terminal interactions.
We acknowledge two key limitations that outline future directions. First, because task instructions are produced via LLM completion, the resulting task distribution inherits biases from the generator model. Second, all environments are instantiated with Ubuntu-based Docker images and predominantly exercise GNU/Linux utilities; extending the pipeline to other Linux distributions and operating systems could help agents move beyond fixed environment assumptions and improve generalization, and remains a direction for future work.
Below is an example of the domain-specific system prompt used in the Magpie-style active sampling stage (Section 3). This prompt steers the LLM to synthesize task queries for the Data Science domain.
Now you are provided with a Ubuntu Docker container. Your task is to solve complex, multi-turn problems by interacting with the terminal.
Note that the task descriptions are concise, but the execution is technically demanding.
The problem description will follow the following format:
## Task Title: [A concise, descriptive title]
Domain Focus: Data Science & Data Processing
Objective: [Summarize the final goal of this data science and data processing task in one sentence.]
Scenario: [Describe a brief background or context to make the task realistic and engaging.]
Todo Checklist:
- [ ] Todo 1:
- [ ] Todo 2:
- [ ] Todo 3:
- [ ] Todo 4:
- [ ] Todo 5:
- ... (continue as needed; 6–10 items total)
Each domain uses a prompt with the same structure but with its domain focus replaced accordingly (e.g., “Networking & Security”, “System Administration”, “AI & ML”).
Below is the prompt used to filter generated terminal tasks before executable environment synthesis. The filter rejects tasks that are infeasible for an autonomous agent to complete in a CPU-only, single-machine Docker environment within a reasonable timeframe.
You are an Expert DevOps and AI Capability Evaluator.
Your job is to analyze a generated Terminal/Command-Line Task and determine if it is FEASIBLE for an autonomous AI agent to execute within a CPU-only, single-machine Docker environment in a reasonable timeframe (e.g., \(<\) 1 hour) by interacting with the terminal.
Criteria for infeasible tasks (reject these):
Extreme Complexity / Hallucination: Tasks that are wildly unrealistic or require massive engineering teams.
Example: “Write a GPT-4 level LLM from scratch in C++.”
Example: “Create a full operating system kernel overnight.”
Vague / Ambiguous: Instructions with no clear success criteria.
Unavailable Resources: Tasks that depend on missing hardware (GPUs, physical peripherals) or require external authentication.
Any other tasks that you deem unreasonable or impractical based on your expert judgment.
You must respond in strict JSON format:
{
‘‘feasible’’: boolean,
‘‘reason’’: ‘‘Explanation of why it is accepted or rejected.’’,
‘‘difficulty’’: ‘‘Easy/Medium/Hard/Impossible’’
}
Below are the prompts used in the five-stage executable environment synthesis pipeline described in Section 3. Each stage agent reads the shared agent_logs/ directory containing outputs
from all preceding stages.
You are an expert at creating testable programming tasks for benchmark evaluation.
I have a task description that needs to be enhanced with specific testable constraints.
Your job:
Analyze the task to understand: high-level goal and requirements; programming language and tools needed; expected inputs and outputs; how to make it more testable.
Transform it into testable format with specific constraints: clear implementation requirements (functions, classes, specific input/output specifications with concrete file paths, e.g., /app/input.json); data structure
handling requirements; technical stack specifications; output format requirements (JSON structure, CSV format, etc.).
Structure instruction.md clearly: brief task description (1–2 sentences); technical requirements (language, input and output files); input/output specifications with examples; data format specifications (with precise details); edge cases and error handling (if applicable).
Important: Use /app as the working directory. Make requirements specific and testable. Avoid leaking test cases or any solution guidance in the task description.
You are an expert at creating Docker environments for terminal tasks.
I have a structured task with detailed instruction.md. Your job is to:
Analyze the task requirements to determine what test data files are required as inputs.
Create environment/ directory structure: environment/[data files] — any input test data files mentioned in instruction.md; environment/Dockerfile — container environment based on
the base image template.
Dockerfile requirements: Start with a fixed base image configuration (Ubuntu 24.04 with tmux, asciinema, uv, Python 3.13, OpenHands, and Claude Code pre-installed). After the base setup, add task-specific configuration: set
WORKDIR, COPY test data files to their required locations.
Test data files: Create realistic sample data files mentioned in instruction.md. Files should be small but representative. Match exact specifications from instruction.md.
Important: Do NOT install any additional packages; rely solely on the base image configuration.
You are an expert programmer who creates reference solutions for benchmark tasks.
I have a task with instruction.md and environment/. Your job is to create a complete reference solution.
Solution structure: Create solution/solve.sh that must start with a benchmark canary string (a fixed GUID marker for downstream decontamination audits), implement all requirements from instruction.md, handle
all edge cases, follow exact output format specifications, and use /app paths.
Quality standards: Complete working implementation; handles all edge cases; uses appropriate libraries; clean, efficient code; proper input/output handling.
Previous agent logs in agent_logs/ provide context on how instruction.md was enhanced (Step 1) and what environment and test data were created (Step 2).
You are an expert at creating test suites for Harbor benchmark tasks. High-quality benchmark tests require multiple rounds of mental iteration to be robust.
I have a complete task with instruction.md, environment/, and solution/. Your job is to create focused, standard tests that verify core functionality.
Test files:
tests/test.sh — Entry point that installs dependencies (uv, pytest), runs the test suite, and writes a binary reward to /logs/verifier/reward.txt.
tests/test_outputs.py — Pytest suite that validates output files, structure, content, and edge cases.
Mandatory four-phase adversarial iteration for each assertion:
Draft: Write the initial validation check.
Attack: Simulate a lazy agent that emits an empty file, incorrect data, or a hardcoded dummy payload. If any of these pass, the assertion is too weak.
Refine: Simulate an expert agent that uses a different implementation approach but produces correct results. If the assertion false-rejects, it is over-specified.
Finalize: Write the robust version based on the preceding attack and refinement steps.
You are an expert at creating Harbor benchmark task configurations.
I have a complete task with instruction.md, environment/, solution/, and tests/. Your job is to analyze everything and create an accurate task.toml configuration.
Requirements:
Analyze the complete task to determine: task difficulty (easy/medium/hard based on solution complexity); task category; appropriate technology tags (3–5 tags); time estimates for experts and juniors; resource requirements (CPU, memory, storage).
Examine all generated files: instruction.md, environment/Dockerfile, solution/solve.sh, and tests/.
Create task.toml declaring verifier, agent, and build timeouts, CPU, memory, and storage quotas.
Guidelines: Resource allocation ranges from basic tasks (1 CPU, 2048 MB) to ML/build tasks (2–4 CPUs, 4096–8192 MB). Verifier timeout ranges from 360s (simple) to 900s (complex builds). Agent timeout ranges from 1800s (simple) to 3600s (complex).
Previous agent logs from all four preceding steps are available in agent_logs/ for accurate resource estimation.
Below is the prompt used by the LLM judge to filter collected terminal-agent trajectories according to the behavioral criteria described in Section 3.
You are an expert analyst of AI Agent behaviors, specializing in evaluating Agentic Capabilities.
Your task is to analyze the conversation trace and diagnose how the agent handles obstacles, errors, or feedback. You must classify the agent’s behavior into specific categories regarding its Adaptability, Groundedness, and Persistence.
Evaluation Framework.
1. Adaptability. Analyze if the agent gets stuck in loops or fails to pivot strategies.
Mechanical Loop: Repeating the exact same command after encountering an error. This is the lowest level of failure.
Rigid Strategy: Although parameters (like syntax) are slightly modified after an error, the logical path to solve the problem remains unchanged (e.g., constantly looking for a file in the wrong folder, just changing the filename), leading to continued failure. This is also a type of “soft loop”.
Strategic Pivot: Analyzing the cause after an error and switching to a completely different tool or path (e.g., search yields nothing \(\rightarrow\) switch to browse; tool error \(\rightarrow\) check documentation). This is not a loop.
2. Groundedness. Analyze if the agent fails to be reality-aligned.
Ignoring Feedback: The tool returns an error, but the agent claims “Task completed” in the next step.
Hallucinated Success: Assuming a file exists or a state is achieved without tool verification.
Context Drift: Forgetting that a certain method was already attempted and failed in previous steps.
3. Persistence. Analyze if the agent gives up on the task prematurely when facing obstacles.
Premature Surrender: Concluding the task is impossible or “cannot be completed” immediately after encountering an environmental limitation (e.g., missing compiler, command not found) without attempting reasonable alternatives or workarounds (e.g., checking for other binaries, verifying paths, or trying fallback methods).
Note: The conversation may end abruptly due to external constraints (e.g., timeouts or step limits). Do not penalize the agent for an uncompleted task simply because the log ends. A lack of persistence is found only when the agent
voluntarily abandons the task (e.g., actively marking task_complete = true or declaring the task impossible) while the objective remains unfulfilled. If the agent is actively planning or executing a step when the conversation stops, this is
not a failure.
Note: If the agent discusses the difficulty in its thought process but eventually decides to try another approach (e.g., “Wait, let me reconsider...”), this demonstrates good persistence and is not a failure.
4. Refusal & Stoppage. Analyze if the agent explicitly refuses to proceed with the task.
Important: Strictly ignore all JSON formatting-related deviations. Examples include incorrect field ordering (since JSON is unordered) or the presence of conversational text surrounding the JSON object. Even if the agent persists in these formatting habits despite warnings, this is a stylistic choice and must not be classified as Rigid Strategy or a capability failure. Focus solely on the logical problem-solving actions contained within the data.
The judge must respond in strict JSON format with the fields reason, has_adaptability_failure, has_groundedness_failure, has_persistence_failure, and triggered_refusal.
All LiteCoder-Terminal models are fine-tuned using the AutoAlign framework with DeepSpeed ZeRO-3 parallelism on 8 GPUs per node. We use the AdamW optimizer with a learning rate of \(5 \times 10^{-6}\), a
cosine learning rate scheduler with a warmup ratio of 0.04, and a weight decay of 0.1. Models are trained for 3 epochs with a per-device batch size of 2 and gradient accumulation steps of 2, yielding an effective batch size of 32. All training is conducted
in BF16 precision with gradient checkpointing enabled. The maximum sequence length is set to 65,536 tokens.
For DMPO, we start from LiteCoder-Terminal-4b-sft and train on trajectory-level preference pairs constructed from LiteCoder-Terminal-RL. We use DeepSpeed ZeRO-3 parallelism on 8 GPUs, with a learning rate of \(5 \times 10^{-6}\), cosine learning-rate scheduling, warmup ratio 0.04, weight decay 0.1, \(\beta=0.1\), \(\gamma=0.7\), and 3 training epochs. The per-device
training batch size is 1 with gradient accumulation steps of 4, and the maximum sequence length is 65,536 tokens.
By open-sourcing LiteCoder-Terminal-SFT, LiteCoder-Terminal-RL, and LiteCoder-Terminal, our work lowers the barrier for building open-source terminal and software engineering agents, enabling broader participation
in research and innovation. At the same time, stronger terminal agents include potential malicious or unintended uses, especially when allowed to execute commands in unconstrained environments. We therefore recommend that these models be used under human
supervision and inside sandboxed execution environments with appropriate resource, network, and permission controls.
December, 2025–present↩︎