Why Coding Agents Can See but Cannot Act Precisely: From Open-Book Evaluation to Robotic Closed-Loop Control
This article examines why high agent evaluation scores do not necessarily translate into reliable execution. It compares open-information and closed-information conditions, discusses why a full environment reset can be more effective than restoring a seemingly precise intermediate state, and recommends stage-wise failure annotation instead of recording only success or failure. It then analyzes three typical robotic error classes—state estimation, planning and physical constraint mismatch, and feedback interpretation—and describes how agents can form their own strategies when training resources and interactive environments are available. Finally, it outlines evaluation dimensions and engineering practices for building agent systems that are observable, verifiable, recoverable, and transferable.
1. From High-Scoring Evaluation to Real Execution: The Problem Is Not “Can It?” but “Can It Complete Reliably?”
In recent years, agent evaluation has gradually shifted from single-turn question answering to continuous task execution. A system must not only understand instructions but also read context, plan steps, call tools, modify code, run programs, and continuously correct its behavior based on feedback. For coding tasks, this mode is often called closed-loop execution: the agent proposes an action, the environment returns a result, and the agent adjusts its next action according to that result.
Under open-information conditions, an agent can consult documentation, search for existing implementations, use training materials, or refer to examples, so task completion rates are often relatively high. When external materials are removed and the system can rely only on its existing capabilities and the current context, performance drops noticeably. Some controlled experiments have shown completion rates of around 80% under open conditions and less than half under closed conditions. This gap indicates that evaluation results cannot be equated simply with a model’s “pure reasoning ability”; they are also affected by information availability, tool permissions, environment feedback, and task initialization.
Robotic tasks deserve even more attention. Robots do not face static text but dynamic environments that include sensor noise, action latency, physical collisions, and state uncertainty. Even if an agent can accurately identify an object’s position, it may not be able to calculate a stable grasping trajectory. Even if it generates a syntactically correct control program, the program may fail because of execution timing, coordinate errors, or dynamic constraints.
Therefore, when measuring agent capability, three levels must be distinguished:
- Is perception correct? Has the agent identified the scene, target, and current state?
- Is the plan reasonable? Has the agent produced an action sequence that satisfies the constraints?
- Is execution reliable? Do actions occur as expected in the real environment, and can deviations be handled?
“Seeing accurately” is only a necessary condition for task completion, not a sufficient one.
2. Why Resetting the Environment Can Be More Effective Than Restoring a Precise State
In continuous task evaluation, a common practice is to restore the environment to some intermediate state after an agent fails and then let it try again. Ideally, the more precise the restored state, the fairer the experiment and the more useful it is for locating the problem. In practice, however, the result can be the opposite: simply resetting the task may make it easier for the agent to succeed than restoring a seemingly precise intermediate state.
The reason is that an intermediate state usually contains not only explicit variables but also many implicit factors. For example:
- whether the previous action has already had a delayed effect on the environment;
- whether old data remains in the sensor cache;
- whether the controller internally stores historical errors;
- whether the agent still relies on earlier incorrect reasoning conclusions;
- whether external tools remain in an uncleared temporary state;
- whether task objects have undergone irreversible physical changes.
If only position, score, or a few visible parameters are restored without clearing these implicit states, the system enters a condition that is “superficially correct but internally contaminated.” The information received by the agent may look reasonable, yet its next action can still be affected by historical errors.
By contrast, a full reset clears the environment state, caches, temporary variables, and incorrect context at the same time, allowing the agent to re-establish its judgment of the task. Although this sacrifices some experimental efficiency, it reduces interference caused by state contamination.
This shows that restoration mechanisms should distinguish between two goals:
1. Restoration for Continuing a Task
The focus is to return the system to an actionable state as quickly as possible. In this case, a full reset is usually safer, especially for tasks where the cause of failure is unclear, the environment state is complex, or internal variables are difficult to observe.
2. Restoration for Analyzing the Cause of Failure
The focus is to preserve the failure scene and reproduce the original conditions as closely as possible. This requires recording a complete state snapshot, including environment variables, tool-call records, sensor inputs, action queues, random seeds, and agent context. Otherwise, so-called “precise restoration” may restore only the surface state.
3. Stage-Wise Annotation: Do Not Record Only “Success” or “Failure”
If only final results are counted, it is impossible to answer a key question: at which step did the task fail? Was it a perception error, a planning error, or an execution error?
A more effective approach is to record each task by stages. A complete task can be divided into:
- Goal parsing: Did the agent correctly understand the user’s intent and completion conditions?
- Environment observation: Did it obtain sufficient and valid state information?
- Task decomposition: Did it break a complex goal into executable subtasks?
- Action planning: Did it generate steps that satisfy the constraints?
- Tool or code generation: Is the output syntactically correct, and are interface calls reasonable?
- Execution feedback: Did the action actually affect the target environment?
- Result judgment: Did it correctly identify success, failure, or partial completion?
- Error recovery: Did it choose an appropriate retry or fallback strategy?
In an analysis covering ten agents and more than 6,000 failure samples, an important phenomenon was that different agents often failed at the same stage. This suggests that failures do not come entirely from accidental defects in a particular model; they may also reflect structural difficulties in the task itself.
For example, if multiple systems fail at the “result judgment” stage, the problem may not be insufficient coding ability but rather that success criteria are not clearly expressed. If multiple systems fail at the “action execution” stage, it is necessary to check whether tool feedback is timely, whether coordinate systems are consistent, and whether the action interface provides sufficient constraint information.
It is recommended to record each attempt in a form such as the following:
Task ID:Initial state:Goal description:Stage 1 result: pass / fail / uncertainStage 2 result: pass / fail / uncertainFailure type:Triggering action:Environment feedback:Retry:Result after retry:Root-cause assessment:
Among these, “uncertain” is very important. In real tasks, a system sometimes cannot determine whether it has succeeded. Forcing such cases into either success or failure would hide observational blind spots in evaluation.
4. Three Typical Error Classes in Robotic Scenarios
1. State Estimation Error
Robots rely on cameras, position sensors, force sensors, and other devices to obtain environmental information. Sensor outputs usually involve latency, noise, and occlusion. An agent may believe that a target is at a certain position, but by the time it actually executes, the target has moved, or the current coordinates are inconsistent with the planned coordinates.
This type of problem cannot be solved only by adding more language descriptions. Instead, it is necessary to provide timestamped observations, coordinate transformations, and state confidence. For low-confidence states, the system should prioritize confirmation actions rather than directly performing high-risk operations.
2. Mismatch Between Plans and Physical Constraints
Plans generated by language models are often logically valid but do not necessarily satisfy real-world constraints. For example, an action path may pass through an obstacle, a grasping pose may exceed the range of the mechanical structure, or consecutive actions may lack the necessary waiting time.
Therefore, plans generated by agents need to pass through an independent constraint-checking layer, including collision detection, speed limits, joint ranges, payload capacity, and action timing validation. Natural-language “reasonableness” cannot be directly treated as physical “executability.”
3. Feedback Interpretation Error
After an execution failure, an agent may incorrectly believe that an action has been completed or may mistake a temporary environmental change for a final result. The system then continues along an incorrect path, causing all subsequent steps to fail.
A better design is to give every action verifiable completion conditions. For example, a placement action should not only issue a “move and release” command but also check whether an object is detected in the target area, whether the object pose is stable, and whether the robotic arm has returned to a safe position.
5. Why Agents Form Their Own Strategies When Training Resources Are Available
In tasks with computing resources, training data, and interactive environments, agents often do not always rely on manually written rules. Taking a simplified soccer-like control task as an example, a system can gradually learn strategies for movement, tracking, passing, and shooting through repeated trials.
This process usually involves four stages:
- Generate initial behavior: take actions first based on the task description or existing examples;
- Collect feedback: record metrics such as score, distance, collisions, and time;
- Induce effective patterns: analyze which action sequences are more likely to receive positive feedback;
- Update the strategy: adjust the priority of actions or control parameters for the next round.
It is important to note that autonomous training does not mean the system has acquired general capabilities. A strategy may apply only to the current field, current speed, or current target distribution. Once the environment changes, the original strategy may fail. Therefore, training should include different initial positions, different obstacle layouts, and different noise levels to test whether the strategy truly generalizes.
At the same time, the training objective should not rely on a single score. If only the final result is rewarded, the agent may learn high-risk shortcuts or even exploit environment loopholes. A more reasonable objective function should also consider:
- task completion rate;
- action safety;
- execution time;
- energy consumption;
- retry count;
- state-estimation confidence;
- adaptability to environmental changes.
6. How to Build a More Reliable Agent Evaluation System
To avoid misleading conclusions such as high scores with open information and distorted results with closed information, evaluation should include at least the following dimensions:
Information Conditions
Test open documentation, limited documentation, and fully closed environments separately to measure the agent’s dependence on external knowledge.
State Restoration
Compare full reset, partial restoration, and precise snapshot restoration to observe the impact of state contamination on results.
Task Length
Cover single-step tasks, short-chain tasks, and long-chain tasks. The longer the task, the higher the probability that local errors accumulate into global failure.
Feedback Quality
Test immediate feedback, delayed feedback, noisy feedback, and incomplete feedback to evaluate agent robustness.
Cross-Environment Transfer
Change target positions, obstacle layouts, and action constraints outside the training environment to determine whether the system has learned a general strategy or merely memorized fixed patterns.
7. Engineering Design Recommendations
First, establish replayable execution records. Every observation, decision, tool call, and environment feedback should be saved, preferably with timestamps.
Second, decouple the planning layer from the execution layer. The planning layer is responsible for generating goals and steps, while the execution layer is responsible for validating whether actions are safe, legal, and feasible.
Third, set pre-action checks and post-action validation for key actions. Do not assume that an action has succeeded without validation results.
Fourth, perform stage-wise attribution for failures instead of vaguely recording “insufficient model capability.” Only by knowing where an error occurs can one determine whether to improve prompts, data, tools, or controllers.
Fifth, prioritize recoverable design in high-risk tasks. Actions should be reversible and pausable whenever possible, and should support restarting from explicit checkpoints.
Conclusion
Coding agents and robotic agents share a common challenge: moving from “generating the correct answer” to “reliably completing tasks in real environments.” Open information can significantly improve performance, but it can also mask underlying weaknesses in reasoning and execution. A simple reset is sometimes more reliable than superficially precise state restoration, which shows that implicit state and context contamination must be included in evaluation. Stage-wise annotation of failure processes can reveal the structural reasons why different agents repeatedly get stuck.
Future agent systems should not pursue only higher single-run success rates. They should also possess engineering properties such as observability, verifiability, recoverability, and transferability. Only by unifying perception, planning, execution, feedback, and error recovery into a closed-loop system can agents truly evolve from “being able to explain” to “being able to complete.”
