Coding Agents: Strong Open-Book Results, Unreliable Closed-Book Execution
Coding agents can perform well with reference solutions yet struggle when they must discover constraints and control an environment on their own. This article examines the gap between open-book and closed-book evaluation, why reliable resets can matter more than exact state information, where agents share failure points, and how self-trained policies affect comparisons. It outlines a diagnostic evaluation workflow built around explicit protocols, stage-level failure analysis, and training metadata.
Coding agents can now read long documents, complete complex code, and use tools to carry out multistep engineering tasks. But performance often drops when the objective shifts from “write a program that runs” to “consistently accomplish a task in a physical or simulated world.”
A comparative evaluation of multiple coding agents illustrates the gap. Under open-book conditions, with access to solutions and hints, leading agents completed roughly 80% of tasks. Under closed-book conditions, with only task instructions and interaction with the environment, completion fell below 50%.
This is not a matter of how the task is worded. The gap reflects capability limits shaped by evaluation protocols, state visibility, and the action-feedback loop.
First, Define What the Evaluation Measures
Open-book and closed-book are not simply synonyms for easy and hard. They describe different information conditions.
An open-book setting typically provides more than a task specification. Agents may also receive reference trajectories, key code snippets, successful demonstrations, or staged hints. In effect, the agent performs program synthesis with the solution available: it translates a known approach into a sequence of calls that the current environment can execute.
A closed-book setting retains only the goal, interfaces, and observable feedback. The agent must discover constraints, experiment, and correct its own mistakes.
High open-book scores therefore demonstrate retrieval, code generation, and interface alignment. Closed-book evaluation is closer to deployment: there is no reference answer, errors accumulate, and incorrect actions can push the environment into states that are difficult to recover from.
Simply subtracting the two scores and concluding that the model has “become less intelligent” can misdirect optimization. A more useful interpretation is that language and coding capabilities are already strong, while embodied decision-making and long-horizon control remain unreliable.
Accurate Observation Does Not Guarantee Accurate Action
One counterintuitive finding in the comparison was that providing exact state information helped less than providing repeatable resets.
Exact state information includes poses, joint angles, and object coordinates. A reset restores the scene to a known initial distribution and clears hidden internal state.
Exact state addresses observation problems. Many failures do originate in perception: occlusion, inconsistent coordinate frames, mismatched units between simulation and reality, or sensor latency. Yet even with fully visible state, an agent must still choose action magnitude, timing, and recovery strategies at every step. Control error, unstable contact, timeouts, and safety limits turn “knowing where things are” into a separate problem: “deciding how far to move next.”
Resets address credit assignment and experimental reproducibility. Without a reset, an early mistake can contaminate the entire subsequent trajectory. Later failures become difficult to attribute: was the strategy wrong, or had the environment already moved outside the distribution assumed by training and hints?
With a reset, attempts begin from comparable starting points. Success and failure can then be attributed to specific stages rather than obscured by a trajectory that has already gone wrong.
Engineering teams should therefore design these two channels separately:
- The observation channel answers “What is the world like now?” It should emphasize calibration, time synchronization, and uncertainty rather than simply exposing more raw values.
- The experiment channel answers “Is this attempt comparable to the others?” It should emphasize one-step resets, random seeds, initial-state distributions, and snapshots of failure conditions.
More detailed state output cannot fix a scene that is already stuck, an object that has tipped over, or a joint that has exceeded its limits. Better visibility may only let the agent continue planning from an invalid state.
Failures Often Cluster at the Same Stage
Stage-level annotation of more than 6,000 failures across roughly ten agents revealed a consistent pattern: different agents often failed at the same step, rather than at entirely different points.
This suggests that bottlenecks lie substantially in task structure, not just in isolated mistakes by a particular model.
An embodied task can be divided into verifiable stages instead of evaluated only by its final outcome:
- Task interpretation: Have the goal, constraints, and termination conditions been formalized correctly?
- Scene setup: Has the simulator or physical system reached a valid initial state, and are the sensors ready?
- Perception alignment: Have coordinate frames, units, occlusion, and latency been handled?
- Skill selection: Should the agent use scripted control, invoke an existing controller, or learn a policy during the task?
- Contact and execution: Are force, speed, timeouts, and collisions within the safety envelope?
- Recovery: Does the agent reset and retry after failure, or continue from a damaged state?
- Verification: Can success be checked automatically and reproducibly, rather than through a quick human inspection?
Shared failure points tend to appear after contact occurs or after an error becomes irreversible. For example, agents may all generate reasonable path-planning code before a grasp. Execution then diverges at gripper closure timing, repositioning after an object slips, or failure to trigger a reset after a collision.
Annotations should record more than “failed.” They should identify the stage, whether a reset was available, whether observations were sufficient, and whether the action exceeded allowed limits.
Once these records are aggregated, improvements should target the most common failure stage rather than distribute effort evenly across every part of the task.
With Compute Available, Agents May Train Their Own Policies
Tasks such as soccer require continuous control, interaction with opponents, and rapid feedback. In these settings, another behavior deserves attention: when accelerators and training libraries are available, agents often collect samples and train a policy instead of hand-coding a complete control law. They then connect that policy to the execution loop.
This is a reasonable division of labor. Discrete tool calls work well for operations such as opening a door, reading state, or issuing a command. Soccer-like tasks involve sparse rewards and sensitive dynamics, making hand-written thresholds easy to overfit to a single trial.
An agent that discovers a training entry point may therefore reformulate the problem from “generate control code” to “generate a training script and wait for the policy to converge.”
Self-training, however, is not a free route to success. Several conditions must be made explicit; otherwise, failure is merely shifted from reasoning to training:
- Resets must be inexpensive. Each training episode needs to return to a controlled initial state. Slow or incomplete resets can cause the policy to learn artifacts of a malfunctioning test setup.
- Rewards and termination must be computable automatically. They should not depend on subjective judgments that cannot be reproduced.
- Compute, environment steps, and early stopping need budgets. Otherwise, an agent may keep extending training and exploit gaps in the evaluation protocol.
- The trained policy must respect closed-book constraints. If demonstrations can be used for distillation during open-book evaluation, external trajectories must not be quietly reused during closed-book evaluation.
Reports should separately record whether the agent invoked a learning process and whether a zero-shot script could already complete the task.
Without that distinction, an agent that can write a training loop may appear exceptionally capable when resources are plentiful, yet become unusable in a deployment environment without accelerators or reliable resets.
Turn the Performance Gap into Actionable Improvements
For engineering teams, a diagnostic evaluation pipeline is more useful than a single aggregate score.
Publish Three Explicit Protocols
Fix and report three settings together:
- Closed-book, zero-shot execution
- Resets allowed, but no reference answers
- Open-book access to reference solutions
The gaps across these settings help distinguish exploration, recovery, and code-translation capabilities. Reporting only open-book results systematically overestimates deployment performance.
Make Reset a First-Class Interface
Reset should not mean manually rearranging the scene after an evaluation finishes. It should be an explicit environment operation covering object poses, internal controller integral state, and random seeds.
Logs should record whether each reset succeeded. In comparative experiments, establish reliable resets before deciding whether to inject exact state information.
Provide Interpretable Observations
State information should include timestamps and coordinate-frame definitions while preserving the associated uncertainty.
“Oracle” coordinates can serve as a diagnostic upper bound, but they cannot replace closed-book results. If oracle state provides only a small improvement while resets produce a substantial gain, engineering effort should focus on recoverability and contact-stage execution rather than adding more sensor fields.
Standardize Failure Analysis
Use a shared stage taxonomy to annotate every failure. Track the most frequent failure stage, the proportion of cases at that stage where a reset was available, and the degree of overlap across agents.
High overlap suggests that the task and environment deserve attention first. Low overlap makes differences in prompts, tools, and models more relevant.
Make Policy Training an Explicit Capability
Whether training is allowed should be stated directly, not left as an implicit workaround.
Record sample counts, accelerator use, reset counts, and the final policy’s success rate on the closed-book initial-state distribution. Without this metadata, self-training can become an invisible cost that makes results incomparable.
The following vendor-neutral record structure captures a basic set of recommended evaluation fields:
task_id, protocol(open|reset_only|closed),stage_failed, reset_ok, state_injected,used_learned_policy, attempts, success
When aggregating results, group first by protocol and stage_failed, then examine success rates. This helps answer three questions:
- Which information condition accounts for the closed-book performance drop?
- Do failures concentrate at the same stage?
- Do improvements come from resets, state information, or policy training during the task?
Conclusion
High open-book completion rates show that coding agents can synthesize code and use tools effectively. The sharp decline under closed-book conditions shows that embodied tasks remain constrained by long-horizon control, uncertain contact dynamics, and irreversible errors.
Exact state information primarily improves observation. Reliable resets improve the ability to make another comparable attempt—and can be more important for identifying the real bottleneck.
When multiple agents repeatedly fail at the same stage, teams should improve that stage’s environment and verification process rather than only replace the model. When accelerators and training libraries are available, agents may train their own policies; evaluation must account for that path separately and validate it independently.
Explicit protocols, reliable resets, stage-level annotations, and training metadata turn the open-book/closed-book gap into engineering decisions rather than a set of unexplained scores.
