Attributing Efficiency of Complex Agent Tasks in a Unified Execution Framework

    This article presents a controlled experiment that isolates how model configuration, tool-call granularity, retry strategies, and context management affect the total time an AI agent takes to complete complex front-end product tasks. Instead of treating "model speed" as a single factor, it breaks down efficiency into measurable engineering dimensions and offers a reusable evaluation and optimization approach.

    In complex front-end product tasks, whether an agent’s final output is “usable” is only the first question. More important is how the agent reaches that result: the number of action rounds, tool-call granularity, failure recovery strategies, context management, and service stability all significantly change total elapsed time. Based on an internal controlled experiment, this article discusses how to reduce “model speed” to explainable engineering efficiency problems under a unified execution framework.

    Why Variable Control Matters in a Unified Execution Framework

    Complex product tasks often involve multi-state pages, multi-role permissions, drag-and-drop with comment positioning, version switching, approval flows, and state persistence after refresh. If you change the execution framework, browser automation method, assets, and acceptance rules at the same time, it becomes difficult to attribute the final time difference to any single cause. A more reliable approach is to fix the execution framework, task description, assets, context budget, browser control interface, and acceptance rules, while only replacing the model configuration. First-attempt screenshots, repair counts, logs, and metric data should all be preserved.

    The controlled experiment used four configurations running the same creative studio collaboration system task. The input included several open image assets, members, materials, versions, and comment seed data. The task required completing five states: project overview, mood board, asset comment positioning, version approval, and publish preview, while supporting three roles: creative director, designer, and client. Desktop was checked at 1440×1000, mobile at 390×844. Each configuration saved first-attempt screenshots and allowed only one repair round. The final output included code, screenshots, logs, review records, and metrics. All four configurations eventually completed the task, but the differences in process were far greater than the differences in final screenshots.

    Time Differences Are Not Simply a “Model Speed” Issue

    The anonymized results from the four configurations showed different patterns:

    • The fastest configuration finished in about 17 minutes.
    • One configuration failed on the first attempt and then re-ran the whole task; including the re-run, it took about 1 hour 12 minutes.
    • Another configuration did not restart the entire round but carried three automatic retries internally, executing for about 88 minutes.
    • One configuration had two consecutive failures under the default retry policy, then completed after an extended backoff; time to first success was about 1 hour 4 minutes, with a cumulative retry count of 85.

    All four delivered usable results, but the efficiency gap was severalfold. This observation shows that “low cost” or “high speed” only describes part of model capability. Real agent efficiency is influenced by at least five factors: whether action rounds converge, whether tool calls are stable, whether server errors are recoverable, whether retry strategies are appropriate, and whether context is effectively compressed and reused. Looking only at single-step generation speed misses long-tail failures and recovery costs.

    Key Attributions: From Action Rounds to Context Management

    First, the number of action rounds determines interaction overhead. Complex tasks require multiple file reads and writes, browser operations, screenshot comparisons, and fixes. If the model tends to take small exploratory steps, the round count inflates quickly. If planning is too coarse, failures concentrate in the acceptance phase. An ideal strategy is “coarse planning with small-step verification,” with checkpoints after key states.

    Second, tool-call granularity affects the failure radius. Splitting “open page, locate element, input, screenshot” into too many calls increases round trips; merging too much reduces recoverability. In engineering practice, tool calls should have idempotent semantics so they can be safely replayed after failure, and each call should log an input summary and result status.

    Third, service stability and retry strategies must be layered. Transient errors suit exponential backoff; logic errors should terminate and enter a repair branch; acceptance failures should return to the nearest checkpoint rather than restarting the whole round. In the experiment, the slowest configuration was not incapable of completing the task; rather, its retry policy did not match the failure types, amplifying recovery costs.

    Fourth, context management determines “memory” and “carrying capacity.” Under a unified context window and task budget, the model needs to preserve task constraints, acceptance rules, modified files, and unresolved issues. Common practices include maintaining a structured task state, compressing historical logs, backfilling only the most recent failure context, and generating summaries at phase boundaries. Otherwise, context grows heavier over time, increasing the cost of every later round.

    Fifth, state persistence and acceptance automation determine repair efficiency. When state does not disappear after refresh, approval status can be read back, and screenshots can be compared automatically, this turns “human finds problem” into “system locates problem.” General-purpose capabilities such as logging services, monitoring alerts, and object storage can be used to retain execution traces and artifacts, making it easier to analyze time distribution.

    Reusable Evaluation and Optimization Methods

    For evaluation design, fix the execution framework and acceptance rules. Run at least multiple times and record: first-success time, total time, retry count, tool-call count, failure classification, context usage peak, repair rounds, and screenshot differences. A pseudocode outline:

    1. for config in model_configs:
    2. result = framework.execute(task, config, budget=..., context=...)
    3. record({
    4. "first_success_sec": result.first_success_sec,
    5. "total_sec": result.total_sec,
    6. "retry_count": result.retry_count,
    7. "tool_calls": result.tool_calls,
    8. "failure_types": result.failure_types,
    9. "context_peak": result.context_peak,
    10. "repair_rounds": result.repair_rounds
    11. })

    For optimization, prioritize four actions: add idempotency and timeouts to tool calls; configure layered retries and backoff caps for different error types; write checkpoints at key states and support breakpoint recovery; compress historical context into summaries that retain only constraints, decisions, and open issues. Efficiency competition for complex product tasks is ultimately not about single-step generation speed. It is about failure recovery, context governance, and overall engineering stability.