How to Evaluate Coding Agents That Control Robots

    This article examines how to evaluate coding agents—AI agents capable of generating code and calling tools—when they are tasked with controlling robots. Because such agents can solve the same problem through direct closed-loop control, generated control programs, or train-then-run policies, traditional fixed-scenario success-rate testing is no longer sufficient. The article lays out three design principles: specify results rather than methods, evaluate the same task under privileged, standard, and realtime modes, and diagnose failure causes rather than only scoring. It then covers task and scenario design beyond pick-and-place, a unified infrastructure that runs evaluation with a single command, and how to turn success rates into actionable information through overview, attribution, and comparison views.

    1. The Starting Problem: No Single “Correct” Solution

    Traditional robot policies have clear input and output boundaries: they receive visual frames and sensor readings, and output joint commands or end-effector poses. Evaluation therefore only needs a fixed scene and a fixed initial state, then measures task success rate.

    Coding agents—agents with code generation and tool-calling capabilities—break that boundary. Given the same task, an agent may choose one of three fundamentally different paths:

    1. Direct closed-loop control: map observations to actions and iterate through trial and error.
    2. Write a control program: generate executable logic first, then hand it to a controller.
    3. Train first, then execute: design its own rewards, sample data, train a policy, and then deploy it.

    This creates a fundamental tension. If the evaluation prescribes the implementation, it excludes valid solutions. If it imposes no constraints, fairness and reproducibility cannot be guaranteed. Evaluation design must therefore shift from “testing the process” to “testing the result,” while adding observability into the process.

    2. Three Design Principles

    Principle 1: Specify the Result, Not the Method

    Each task is expressed as a decidable success condition, for example “the object is placed in the target container and remains still,” “the assembly meets the pose tolerance,” or “the robot reaches the region within the time limit without collision.” Whether the agent writes code, controls directly, or trains a policy internally is not restricted by the evaluation framework. This keeps results comparable across approaches and lets different technical routes compete on the same scale.

    Principle 2: At Most Three Modes for the Same Task

    The same task is evaluated repeatedly under different information and timing conditions to quantify how physical and observation constraints affect capability:

    • Privileged mode: full state access and resets allowed, used to verify the capability ceiling.
    • Standard mode: only normal observations, resets not freely allowed, close to real deployment.
    • Realtime mode: the environment does not wait for computation, testing how well reasoning latency matches decision frequency.

    The three modes form a capability profile: the gap between privileged and standard reflects dependence on state estimation, while the gap between standard and realtime reflects the reasoning-efficiency bottleneck.

    Principle 3: Do Not Only Score—Locate the Cause

    A single success-rate number cannot guide improvement. Evaluation needs two diagnostic capabilities: first, isolating variables through controlled experiments (swap the model, the framework, the control method, or the simulator); second, splitting the task into stages (perception, localization, grasping, transport, placement, retreat) and recording which stage the failure occurred in, forming an attributable failure distribution.

    3. Task and Scenario Design: Beyond Pick-and-Place

    Task diversity determines evaluation coverage. A reasonable task pool typically contains about 1156 tasks, 35 task sets, and 47 robots, most adapted from existing benchmarks and covering single-arm, dual-arm, and mobile manipulators. The rest are newly built sets that fill three capability gaps:

    • Sustained contact: deformable object manipulation, multi-part assembly, painting, and tool use, testing force control and long-horizon stability.
    • Dynamic adversarial: moving targets, opponent interference, and timed striking or catching, testing prediction and real-time reaction.
    • Meta capabilities: autonomously interpreting vague goals, judging whether a request is safe and compliant, and adapting controllers under unfamiliar dynamics, testing reasoning and engineering closed-loop ability.

    A schematic task description structure (neutral pseudocode):

    1. task = Task(
    2. goal_spec="place(block, bin) and stable(1.0s)",
    3. success_checker=GeometricChecker(tolerance=0.02),
    4. modes=["privileged", "standard", "realtime"],
    5. stages=["perceive", "grasp", "move", "place", "retreat"],
    6. )

    4. Unified Infrastructure: Run Evaluation with One Command

    To make evaluation reusable, the infrastructure must decouple four layers: the model access layer, the agent framework layer, the control method layer, and the simulator adapter layer. Swapping a model or framework only changes configuration parameters, not the orchestration logic. Control methods are registered as plugins, supporting three executors: direct control, program generation, and policy training.

    Configuration example (neutral illustration):

    1. model: {name: "your_model", params: {temperature: 0.0}}
    2. agent: {framework: "generic_agent", max_steps: 200}
    3. controller: {type: "code_gen"} # options: direct / code_gen / train_then_run
    4. simulator: {backend: "physics_engine", seed: 42}

    In engineering practice, it is advisable to split evaluation into a four-stage pipeline—orchestration, execution, judgment, and archiving—with containerized runs to keep the environment consistent, object storage to save trajectories and logs, monitoring and alerting to track task failure and timeout rates, and message queues to smooth peaks in parallel task scheduling. This enables large-scale parallelism and complete replay after failures.

    5. Interpreting Results: Turning Success Rate into Actionable Information

    Evaluation output should contain at least three layers of views:

    • Overview layer: success rate per mode, average steps, and timeout rate.
    • Attribution layer: a heatmap of the failure-stage distribution, for example “localization error causing grasp failure accounts for 42%.”
    • Comparison layer: differences for the same task across models, frameworks, and control methods, identifying whether the bottleneck comes from reasoning, planning, or execution.

    Practical advice: first look at the privileged-versus-standard gap to judge perception weaknesses, then the standard-versus-realtime gap to judge reasoning latency, and finally use stage attribution to decide which module to improve first. If an enterprise wants to build a similar evaluation, it can construct isolated environments on a container platform and use log services plus monitoring and alerting to close the loop. General-purpose capabilities from cloud providers such as Baidu AI Cloud can serve as the underlying platform, but the evaluation design itself is vendor-independent.

    6. Conclusion

    The core of evaluating coding agents is not “testing whether they can write code,” but fairly comparing different technical routes under equivalent results and breaking failures down to each step. The 1156 tasks provide breadth, the three modes provide constraint dimensions, and staged attribution provides an improvement path—only by combining the three can “agents commanding robots” be measured scientifically.