Terminal Coding Agents: Reinforcement Learning and Task Cost Evaluation
Reinforcement learning for terminal coding agents must be evaluated across the full task execution workflow, not just model outputs. This article explains how to interpret training time, first-attempt success rates, and task costs; design reliable training environments; measure cost per successful delivery; and validate benchmark gains through controlled enterprise pilots.
1. Three Different Questions Behind One Research Experiment
Unlike traditional code completion, a terminal coding agent delivers a result validated through execution, rather than just a code snippet. For a software engineering task, the agent typically needs to inspect a repository, understand constraints, modify files, run tests, and use the feedback to decide whether to investigate further, revise its approach, or submit the result. The longer this workflow becomes, the less useful a single model call is as a measure of cost. A misguided change can trigger multiple reasoning rounds, repeated tests, and additional human review.
A public research study reported full-parameter reinforcement learning on an existing model with roughly 300 billion parameters, using 64 accelerators and completing training in less than five days. The trained agent achieved a 46.2% first-attempt success rate on a terminal-task benchmark, with improvements also observed on two other software engineering benchmarks. Under the study’s stated pricing and inference settings, the cost per task was less than one-thirtieth that of a comparison configuration using the highest reasoning effort. The researchers also published their training recipe, providing more detail for analyzing the training process.
These figures answer three separate questions. Training duration describes how long that training run took under a particular resource configuration. First-attempt success rate measures the agent’s ability to complete tasks independently under predefined rules. The cost difference reflects the expense of a task attempt under specific settings.
These measures are not interchangeable. Less than five days does not mean the entire model was trained from scratch in that time. A 46.2% benchmark score is not a direct estimate of success on internal enterprise tasks. Nor can a per-attempt cost difference be translated directly into production budget savings. The more useful lesson is that training, evaluation, and deployment can be designed around the same task execution workflow.
2. Reinforcement Learning Optimizes the Full Execution Trajectory
A terminal-task attempt usually involves a sequence of decisions. The agent decides which files to read, chooses the scope of its changes, and then uses test results to determine whether more work is needed. Even if the final code is correct, earlier decisions may have wasted substantial time. Conversely, a low-cost, targeted check can sometimes rule out a faulty hypothesis and prevent changes to unrelated modules.
Reinforcement learning can connect the entire execution trajectory to the final outcome. This allows a model to learn not only how to implement a change, but also when to gather information, how to validate its work, and when to stop.
The training environment must reliably determine whether a task is complete. Ideally, each task has a fixed starting state, explicit acceptance criteria, and a reproducible execution environment. For a boundary-condition bug fix, checking only whether files changed cannot distinguish a genuine fix from an unrelated modification or tampering with test logic. A more reliable approach combines acceptance tests for the new behavior, regression tests for existing behavior, and checks on the permitted scope of changes.
If repeated runs of the same submission produce different results because of unstable dependencies or intermittent timeouts, the environment should be fixed before those results are used for training. Otherwise, the feedback may reflect environmental variability rather than the quality of the agent’s decisions.
Success signals and efficiency constraints should be designed separately. Acceptance results answer, “Was the task completed correctly?” Step counts, execution time, and resource usage answer, “What did it cost?”
Strongly penalizing execution time from the outset may encourage the agent to skip necessary tests or stop prematurely. Leaving resource use unconstrained, however, may allow repeated spending on low-value attempts. Teams can first establish limits on execution time, resources, and permissions, then compare successful trajectories within those boundaries. Execution records can reveal whether the main costs come from inference, environment startup, or repeated validation. Only after identifying the dominant overhead can a team decide whether to prioritize better model decisions, tool feedback, or execution infrastructure.
Reproducing training requires more than accelerator counts and elapsed days. Full-parameter reinforcement learning updates all model weights; it is not the same as pretraining from scratch. To assess reproducibility or transferability, teams should also examine the training task distribution, environment construction, effective sampling volume, model update strategy, and checkpoint selection method.
Enterprise teams do not need to begin with full-parameter training. If a baseline system frequently fails because requirements are ambiguous, dependencies are not pinned, or test feedback is missing, correcting those problems is usually more direct than adding training. Further training investment becomes worth evaluating when failures consistently reflect observable, repeatable weaknesses in the agent’s decisions.
3. Evaluate First-Attempt Success Alongside Cost per Successful Delivery
First-attempt success does not mean the model may produce only one output. It means each task receives one independent attempt, which must satisfy acceptance criteria within a predefined budget. That attempt may include multiple rounds of file access, edits, and tests. What is not allowed is rerunning a failed task several times and counting only the best result as a first-attempt success.
Comparisons should hold task versions, starting states, permissions, acceptance rules, and timeout criteria constant. If systems use different budgets, those differences should be disclosed rather than presenting the scores as directly comparable.
Cost also requires two distinct metrics:
- Average cost per attempt: Total evaluation cost divided by the number of attempts. This measures the average expense of initiating a task.
- Average cost per successful delivery: Total evaluation cost divided by the number of tasks that pass acceptance. This includes the resources spent on failed attempts and measures the average expense of obtaining an acceptable result.
If no task passes, report zero successes and the total expenditure rather than presenting an apparently finite cost per successful delivery.
Production-oriented evaluations should also specify what is included in total cost: model inference, isolated environment execution, testing, retries, and human review, for example. If training or deployment investments are included, explain how they are allocated so that one-time and recurring expenses are not mixed without clarification.
Averages alone are insufficient. A large number of easy tasks can obscure failures on complex work, while a small number of expensive, long-running tasks may consume most of the compute. A more useful approach groups tasks by type and difficulty, recording first-attempt success rate, total expenditure, median completion time, high-percentile completion time, and the proportion requiring human takeover.
Teams can then run the same task set at different budget levels to determine how much additional success the extra resources provide. If a higher budget benefits only a small subset of complex tasks, but the gains justify the added expense, tiered execution may be appropriate. If failures mainly stem from missing requirements or environment errors, increasing the reasoning budget generally will not address the root cause.
4. Validate Benchmark Transfer Through an Enterprise Pilot
Step 1: Build a task set that reflects real work. Select historical tasks with recoverable starting states, automated acceptance checks, and clear permission boundaries. Include work such as adding tests, fixing narrowly scoped defects, and making cross-module changes.
For each task, record the input information, permitted scope of modification, acceptance criteria, and risk level. Keep acceptance answers separate from materials visible to the agent. Also separate tasks used for iteration from those used for final comparison, so that optimization on familiar examples is not mistaken for generalization.
Step 2: Standardize observability before comparing systems. For every attempt, record execution time, the number of test runs, the stopping reason, acceptance results, and any human intervention.
At a minimum, classify failures as requirement misunderstandings, environment failures, implementation errors, or budget exhaustion:
- If environment failures dominate, prioritize task images and dependency management.
- If implementation errors dominate, examine whether the model can use test feedback effectively.
- If budget exhaustion dominates, determine whether time is being spent on reasoning, long-running tests, or unproductive repetition.
This classification provides more practical guidance for the next engineering investment than a single leaderboard score.
Step 3: Expand capabilities gradually within an isolated environment. Initially, allow the agent to read only the repository snapshot needed for the task and write only within an isolated workspace. Do not provide production credentials, and restrict network access, execution time, and resource usage.
Treat outputs as proposed changes subject to existing tests and human review. Configuration changes, permission adjustments, and cross-module modifications should retain stricter approval requirements and traceable records. Where tests do not provide sufficient coverage, passing them should not be considered sufficient grounds for automatic merging.
The final output of a pilot should be more than a success-rate report. It should establish clear task-routing rules: which tasks can be automatically validated under a standard budget, which justify a larger budget only when acceptance criteria are explicit, and which should be handed to a human early.
Training and benchmark advantages become engineering gains only when the agent maintains the required quality under comparable evaluation conditions and still lowers the cost per successful delivery after failures, waiting time, and review are included.
