Evaluating Programming Agents That Control Robots
A practical evaluation method for code-generating agents on robots should measure closed-loop behavior under physical constraints, not just whether a plausible program is produced. This article defines three control paths, three evaluation modes, task categories, staged failure logging, and infrastructure requirements so scores stay comparable and point to concrete engineering fixes.
Putting a code-generating agent on a robot is not mainly a test of whether it can emit a program that looks reasonable. The real question is whether, under physical constraints, it can turn a goal into an executable, recoverable, and interpretable action sequence. A single overall success rate often hides which layer failed. A usable evaluation should measure capability boundaries and indicate where to improve.
Define what is being tested
Programming agents that command robots typically follow three control paths.
The first is direct control: the agent maps observations to joint, end-effector, or chassis commands. This path is most sensitive to latency and stability and is suited to testing closed-loop decision making.
The second is writing programs: the agent generates a controller, state machine, or skill-call sequence from a task description, which a runtime then executes. This tests task decomposition, interface use, and exception handling rather than single-step reflexes.
The third is training or tuning policies: within a allowed simulation budget, the agent chooses rewards, curricula, or controller parameters so a lower-level policy adapts to new dynamics. This tests whether the agent treats learning itself as a tool.
The evaluation infrastructure should run all three paths on the same task protocol: the same observation interface, success criteria, and log format. When you swap models, agent frameworks, or simulators, only the integration parameters should change. Otherwise scores are not comparable.
Three modes that separate physical constraints
Each task may use up to three modes that change what the agent sees, whether it can retry, and whether the environment waits.
Privileged mode provides complete or nearly complete state: object poses, contact, hidden goals, or privileged sensors. It answers whether planning and control suffice when information is ample. If this mode already fails, inspect action spaces, collision handling, and skill interfaces before blaming vision.
Standard mode provides only observations that are reasonable at deployment, such as cameras, proprioception, and task text. Arbitrary resets to intermediate states are not allowed, but the environment can still advance in episodes. This is closer to lab evaluation: the agent must maintain world state and recover from errors.
Real-time mode removes the convenience of the environment waiting for the agent to finish thinking. Objects keep moving, opponents keep acting, and timeout is failure. It exposes slow planning, repeated tool calls, and inability to submit executable actions before a deadline.
Read the three modes together. High privileged and low standard scores usually point to state estimation or scene understanding. High standard and low real-time scores usually point to latency and decision cadence. Low scores in all three mean the task representation or control primitives themselves do not hold. Do not average the three scores into one ranking number.
Cover three capability classes, not only “execute a given goal”
The first class is fine manipulation with sustained contact. Deformable objects, multi-part assembly, and tool use require force, contact order, and local geometry to be correct together. Success conditions should be checkable physical predicates, such as insertion depth, coating coverage, or assembly constraints, not “the motion looks like a demo.”
The second class is moving objects and adversarial or competitive scenes. Balls, moving workpieces, or opponents will not wait for a plan. Scoring should include timing, landing points, and rule compliance. Humanoid and mobile-platform tasks belong here because failures often come from acting a beat too late, not from writing the wrong end-effector trajectory formula.
The third class goes beyond executing a given goal. The agent must interpret ambiguous goals, judge whether a request is safe, and adapt controllers to unfamiliar dynamics. Safety items must include samples that should be refused, degraded, or clarified; testing only “success” encourages ignoring constraints. Adaptation items should change mass, friction, or actuator response and check whether the agent re-identifies dynamics or blindly reuses an old program.
The task pool can be large, but public reporting should fix a hard core set and disclose sampling rules. Use the core set for head-to-head comparison and the full set to find long tails. Change one factor at a time—observation, reset, time limit, dynamics, or language instruction—so effects can be attributed.
Score, then localize failure at each step
Split each trial into fixed stages and require replayable logs.
- Goal understanding: which constraints the instruction was parsed into, and whether unsafe or unreachable requests were recognized.
- Scene estimation: whether key objects were localized and whether uncertainty was passed to later planning.
- Skill selection: whether chosen primitives cover the contact type or timing requirement.
- Program or action generation: whether parameters, frames, units, and timing are consistent.
- Execution and monitoring: whether the agent replans when error exceeds a threshold instead of continuing blindly.
- Termination: success, failure, timeout, and safety abort must be mutually exclusive and automatically checkable.
Ablations should change one condition at a time. For the same task, privileged versus standard should differ only in observation; standard versus real-time should differ only in the clock. Stage labels turn “it did not work” into “stuck in estimation” or “stuck at termination.” Report stage-failure distributions, first-failure step, and reset counts, not only terminal success.
A schematic log need not bind to any vendor API if fields stay stable:
task_id, mode, seed, stage, observation_summary, action_or_program_hash, constraint_violated, outcome, latency_ms.
The hash shows whether the agent repeatedly submits the same bad program. latency_ms should enter the primary score only in real-time mode; elsewhere it is diagnostic.
Minimum infrastructure and statistics
One launch command should run a specified task subset. Switch models and frameworks by configuration; keep task logic and scorers read-only. Simulators may be swapped, but physics stepping, random seeds, and success criteria must be written into an experiment manifest. Scores without seeds and a manifest are not a regression baseline.
When comparing agents, fix decoding temperature, tool-call limits, per-step time limits, and total wall-clock budget. Otherwise “slower but more accurate” and “faster but reckless” collapse into one ranking. For the programming path, restrict executable code: no out-of-task network, no scorer edits, no reading of ground-truth state. That is fairness and a safety boundary.
Do not declare winners on insufficient samples. On the core set, report confidence intervals or at least variance across repeated seeds. List long-tail tasks separately so they are not diluted by average success. Human review calibrates automatic judgments; it should not rewrite scores after the fact.
Feeding scores back into development
If fine manipulation fails in privileged mode, add contact skills and frame conventions before swapping in a larger language model. If dynamic tasks collapse only in real-time mode, put replan frequency, action-submit deadlines, and prediction horizon into the interface contract. If safety items have a low refusal rate, goal understanding is not treating constraints as first-class; prompts and program interfaces should expose allow / refuse / degrade, not only actions.
For production, embed this protocol in continuous evaluation: task versions, scorers, and agent configs go into version control together. After each change, compare only the core set’s stage-failure distribution. Then check a few real-robot tasks against simulation gaps such as friction, delay, and perception noise. Hardware is not another leaderboard; it tests which assumption among the three modes fails in the field.
The conclusion is simple: programming agents that command robots must be tested for closed-loop competence under constraints. Privileged, standard, and real-time modes separate information and time. Stage logs pin failures to a specific step. Evaluation then becomes an engineering instrument rather than a publicity score.
