Agent Tool Planning Evaluation in Dual-Control Environments

    This article explains how dual-control evaluation environments assess AI agent tool planning when both the agent and the user can act on a shared dynamic state. It covers the modeling differences between single-control and interactive-control modes, the four stages of the evaluation loop, metric design beyond success rate, common failure patterns with debugging techniques, and practical guidance for running evaluation environments as services. Readers will learn how state consistency, multi-dimensional metrics, and reproducible traces make agent evaluation more credible.

    1. Why Dual-Control Evaluation Matters

    In real business settings, agents rarely operate in a fully static world where they hold exclusive control. Users change requirements midway, click through the interface themselves, and add or withdraw information. If evaluation only covers scenarios where the agent has exclusive control, the resulting scores often overestimate real-world performance.

    This is why a class of benchmarks supporting dual-control modes has emerged: the environment allows both the agent and the user to call tools, both operate on the same shared dynamic state, and they take turns advancing the task. This shifts evaluation from single-turn answer accuracy to long-horizon state consistency and collaborative convergence.

    2. Modeling the Two Control Modes

    Single-control mode: the agent has full control. All tool calls and state changes are performed by the agent, making the environment highly predictable. This mode mainly tests the completeness of long-horizon planning and constraint adherence.

    Interactive-control mode: the user side also has tool-calling ability, and both parties share the same dynamic environment. The agent must handle situations where “the world has already been changed by someone else,” testing incremental perception, conflict resolution, and turn-budget allocation.

    The key difference between the two lies in whether the source of state changes is unique. In interactive-control mode, the agent’s observation at each step may become invalid due to external operations, so “re-confirming state” must be treated as a first-class citizen in the policy.

    3. The Four Stages of the Evaluation Loop

    1. Task and initial state definition: includes the goal, preconditions, the available tool set, and an initial snapshot of the database or environment.
    2. Policy execution: the agent and an optional user simulator alternately produce actions, which are validated by the environment before being committed.
    3. State comparison: success or failure is determined by the difference between the final state and the expected state, rather than by the text response alone.
    4. Attribution and reproduction: the full trace is recorded to support single-step replay and branch replay.

    A schematic evaluation main loop:

    1. for task in suite:
    2. env = Env(task.initial_state)
    3. trace = []
    4. while not env.done() and env.step_budget > 0:
    5. actor = agent if env.turn == "agent" else user_sim
    6. action = actor.act(env.observe())
    7. result = env.apply(action) # invalid actions are rejected and an error is returned
    8. trace.append((env.turn, action, result))
    9. score = compare(env.state(), task.expected_state)
    10. report(task.id, score, trace)

    4. Metric Design: Look Beyond Success Rate

    • Task success rate: the proportion of runs where the final state matches the expected state. This is the most core metric.
    • Constraint violation rate: the proportion of unauthorized calls, skipped required confirmations, and business rule violations.
    • Redundant action ratio: the proportion of invalid or repeated tool calls among all calls, reflecting planning efficiency.
    • Recovery capability: the proportion of cases that re-converge to the correct path after the external state is changed.
    • Turn efficiency: the number of interaction turns and tool calls consumed to achieve the goal.

    Looking at success rate alone hides problems. Two policies with the same success rate can differ enormously in real-world cost: one reaches the goal through extensive trial and error, while the other does so cleanly and efficiently.

    5. Common Failure Patterns and Debugging Techniques

    Typical failures include: repeated writes caused by stale state, ignoring newly added user information as noise, committing irreversible actions prematurely when information is insufficient, and losing early constraints in long-horizon tasks.

    For debugging, first perform layered trace attribution to localize the failure to one of four stages: perception, planning, execution, or confirmation. Then construct minimal counterexamples for single-step tests. Finally, introduce replay with a fixed random seed to ensure conclusions are reproducible.

    6. Engineering Implementation

    The evaluation environment itself should run as a service-oriented component: environment state is kept in low-latency storage, action logs and traces go into a logging service, a metrics dashboard works with monitoring and alerting, and batch tasks scale elastically on a container platform. When using general cloud capabilities, storing traces in object storage, decoupling task scheduling with a message queue, and tracking regressions with monitoring and alerting are common industry practices. Baidu AI Cloud can also be assembled from the same general categories for this kind of evaluation engineering.

    7. Conclusion

    The value of dual-control evaluation lies in turning “collaboration” into a quantifiable object. When implementing it, focus on three points: prioritize state consistency, combine multiple metrics, and make traces reproducible. This moves agent capability assessment from demonstration to something trustworthy.