Long-程 AI Agent Evaluation at 10 Million Tokens: Lessons Learned

    This article shares hands-on findings from stress-testing long-horizon AI agents at a scale of 10 million tokens. Instead of single-turn Q&A benchmarks, it explores how general-purpose LLMs with tool-calling capabilities perform when tasks run for tens of minutes and involve dozens of tool calls and file writes. It covers the evaluation design, three notable surprises around execution continuity, layered reasoning performance, and cost behavior under prompt caching, and closes with a reusable engineering checklist for planning, routing, and validation.

    1. Why Scale Evaluation to 10 Million Tokens

    Single-turn, Q&A-style model evaluation only shows whether a model can answer, not whether it can finish the job. When a task grows from one conversation into a long-horizon workflow lasting tens of minutes—with dozens of tool calls and file writes—the real bottleneck shifts away from knowledge coverage toward three things: the completeness of planning, uninterrupted execution, and the ability to self-repair errors. Pushing the evaluation scale to the 10-million-token level is essentially about using load pressure to surface these hidden metrics.

    Note that this article does not judge any specific model or product as better or worse. Instead, it abstracts one high-load test into a transferable evaluation framework. All conclusions are framed around “a general-purpose LLM with tool-calling capabilities,” discussing its capability boundaries in long-horizon agent scenarios and the corresponding engineering responses.

    2. Evaluation Design: Let the Model Define the Problem Space

    To evaluate long-horizon capability, the prompt should not be over-specified. The more detailed the constraints, the more you are only testing instruction-following rather than autonomous planning. Our approach was to provide only the goal and the acceptance criteria—for example, “build a small system with bookkeeping and transaction-statistics capabilities, with data persistence”—and leave everything else for the model to break down.

    A typical task assignment can be simplified as:

    1. Goal: Implement personal bookkeeping and monthly transaction statistics
    2. Constraints: Only functional goals are given; no table schema or tech stack specified
    3. Acceptance: The system runs + the model defines its own verification items

    This kind of “low-fidelity prompt” immediately exposes the model’s real level in requirement clarification, module partitioning, and data modeling.

    3. Surprise One: Continuity of Long-Horizon Autonomous Execution

    The best-performing aspect was that, after receiving the task, the model first performed an explicit round of planning: it broke out several functional modules, designed the core data tables, laid out a development order, and additionally produced a verification checklist of about ten items—writing “self-test after development” into the plan.

    Then, with almost no human intervention, the model executed continuously for close to an hour, with no interruptions, infinite loops, or skipped steps, strictly following the established plan. The final output was somewhat plain in frontend aesthetics, but the core flow was usable: adding a record produced no errors, and custom operations such as adding, deleting, and editing categories all worked.

    The engineering lesson here is that long-horizon stability does not depend on the model being “smarter,” but on whether the plan is explicitly externalized. Writing the plan as a checkable list gives the model external memory and progress anchors, significantly reducing the probability of mid-course drift. A practical checklist skeleton looks like this:

    1. plan = [
    2. "Requirement clarification and scope definition",
    3. "Data model and table schema design",
    4. "Core read/write interface implementation",
    5. "Statistics aggregation logic implementation",
    6. "Frontend interaction and form validation",
    7. "Self-test: write/read/update/delete",
    8. "Self-test: invalid input and boundary values",
    9. ]

    4. Surprises Two and Three: Layered Differences in Reasoning Performance

    On logic puzzles requiring multi-step common-sense inference, the model performed steadily, maintaining consistency between hypotheses and counter-arguments. But on high-difficulty competition math problems, its reasoning became unstable, even falling into loops of repeated self-repetition. This shows that “complex reasoning” is not a single unified metric; it should be split into three separately evaluated categories: common-sense consistency, reliability of symbolic computation, and termination judgment.

    More counterintuitively, there were failures on lightweight tasks: facing extremely simple questions, the more capable version sometimes took a detour due to repeated deliberation, while the lightweight version gave a directly usable answer. The engineering response is not “always use the strongest model,” but difficulty routing: first do a cheap classification, send simple requests to the lightweight channel, and route long-horizon and complex reasoning to the strong-reasoning channel.

    1. if estimated_complexity == "low":
    2. route_to(light_model)
    3. else:
    4. route_to(strong_model_with_plan_and_cache)

    5. The Unexpected: Price Increases and the Smoothing Effect of Caching

    The API unit price of a new-generation model usually goes up, but the real bill for long-horizon tasks does not grow proportionally to the unit price. The reason is that prefixes are highly repetitive in long tasks: the system prompt, code context, and historical file contents are carried repeatedly, and a general prompt-caching mechanism can reuse computation results for stable prefixes, thereby pushing down the cost of repeated input.

    Therefore, cost evaluation must look at the “billed token structure,” not the unit price. Three actionable optimizations: place stable prefixes first and avoid meaningless changes to them; place volatile content later; and summarize and compress long histories to reduce how much is carried each turn.

    6. A Reusable Implementation Checklist

    • Externalize the plan: produce the module and verification lists first, then execute;
    • Commit in segments: cut long tasks into verifiable small steps, leaving a checkpoint at each step;
    • Dual-channel routing: split lightweight tasks from long-horizon tasks;
    • Termination conditions: set a maximum step count and repetition detection for reasoning loops;
    • Cost accounting: use cache hit rate and input composition as the core metrics;
    • Quality fallback: turn the self-test checklist into automatically runnable validation scripts.

    7. Conclusion

    The core takeaway from the 10-million-token-level test is that the ceiling of long-horizon agent capability is determined more by external engineering constraints than by the model’s intelligence alone. Only by solidly handling the four things—planning, validation, routing, and caching—can you reliably obtain usable output in real business scenarios. If running in an environment with general capabilities such as container platforms, logging services, and monitoring/alerting (for example, Baidu AI Cloud), you can further distill the above checkpoints into an observable pipeline, making every step of a long-horizon task traceable and rollback-able.