LLM Agentic Coding: Lessons from a Ten-Million-Token Stress Test

    This article distills lessons from a roughly ten-million-token evaluation of LLM agents across long-horizon coding, complex reasoning, lightweight tasks, and cost behavior. It examines where autonomous planning succeeds, why advanced reasoning can become unstable, how overthinking can hurt simple requests, and why cache hits and retry control matter more than unit price alone. Readers gain a practical four-part evaluation framework for model selection and production deployment.

    Introduction: Why Run a Stress Test with Ten Million Tokens?

    When evaluating the engineering capabilities of large language models, short conversations and single-turn questions often fail to expose real weaknesses. Only by placing a model in long-cycle, multi-step tasks that require autonomous planning and tool use can we observe its planning ability, self-correction mechanisms, and stability boundaries. This article is based on a real-world test that consumed approximately ten million tokens in total. It focuses on four themes: agentic coding, complex reasoning, lightweight tasks, and cost structure. The goal is to extract a transferable evaluation methodology that helps developers apply stricter criteria when selecting models and moving them into production.

    It is important to note that this article does not target any specific product. Instead, it generalizes the observed phenomena into common technical questions that can be used for horizontal comparison across models and platforms.

    1. Agentic Coding and Long-Horizon Tasks: Autonomous Planning Is the Dividing Line

    A long-horizon task is an engineering task that requires a model to execute dozens of consecutive steps over an extended time window before it can be completed. It tests not only code generation but also task decomposition, dependency management, and self-verification.

    In one database system design task, we deliberately provided few constraints and gave only the goal, in order to observe the model’s level of autonomous planning. An ideal performance should include three stages:

    • Solution design: First produce an overall architecture, such as the core functional modules and data table structure.
    • Process planning: Plan not only the development of each component but also the autonomous verification checklist to run after development is complete.
    • Continuous execution: Continue coding without human intervention, without stopping, without falling into an infinite loop, and without missing critical steps.
    1. # Ideal closed loop for a long-horizon task (illustrative)
    2. plan = model.plan(goal) # Output module and data-table design
    3. for step in plan.steps:
    4. code = model.generate(step) # Generate step by step
    5. result = sandbox.run(code) # Execute in sandbox
    6. if not result.ok:
    7. model.self_correct(result) # Self-correct
    8. verify = model.verify(plan) # Verify autonomously against the checklist

    In the test, the better-performing models were able to code autonomously for nearly one hour while maintaining planning consistency. The delivered system’s core functions operated normally, with shortcomings only in secondary areas such as interface aesthetics. This indicates that the long-horizon planning and tool-use capabilities of current leading models are already viable for engineering work. However, there is still a gap between “usable” and “good”, especially in non-functional requirements such as UI/UX, performance, and maintainability.

    2. Complex Reasoning: Bright Spots Coexist with Stability Bottlenecks

    Complex reasoning is a key capability that distinguishes model tiers, but it is not linearly reliable. Observations reveal a typical contradiction:

    • Models perform well on puzzle-like tasks that require multi-step logical deduction.
    • On mathematical competition-level problems and some boundary tests, they may enter an infinite loop or reach an incorrect conclusion.

    This highlights the core issue of reasoning stability: a model’s reasoning depth and self-checking mechanisms do not always match the difficulty of the task. Engineering responses include:

    1. Introduce external validation: Use sandboxes, unit tests, or formal checks to confirm conclusions a second time.
    2. Set reasoning budget caps: Define a maximum number of steps or a token threshold for each task to prevent infinite loops from consuming cost.
    3. Decompose instead of forcing a direct solution: Break highly difficult problems into verifiable subproblems to reduce the pressure on each reasoning step.

    3. The Overthinking Trap in Lightweight Tasks

    One counterintuitive phenomenon is that, on simple problems, more capable flagship models can sometimes give incorrect answers because of overthinking, while lightweight versions can be more efficient because they are more direct.

    Behind this is a mismatch between reasoning-chain length and task complexity. For simple tasks, an overly long chain of thought introduces unnecessary branches and self-doubt, increasing both the probability of error and latency. Practical recommendations:

    • Route models by task complexity: Send simple tasks to lightweight models and complex tasks to flagship models.
    • Control the thinking budget: Allow reasoning chains to be disabled or shortened for low-difficulty requests.
    • Build a regression test set: Include simple questions in testing to prevent capability regressions that may accompany capability upgrades.

    4. Cost Structure: A Higher Unit Price Does Not Mean a Proportional Increase in the Bill

    Model iterations are often accompanied by API unit-price increases, but actual bills are affected by multiple factors and cannot be judged by unit price alone. In long tasks, caching mechanisms—the reuse of repeated prefixes, system prompts, and context—can significantly reduce repeated computation, making the total bill increase smaller than the unit-price increase.

    The key variables affecting cost can be summarized as follows:

    Factor Effect on cost Optimization direction
    Unit price Directly determines baseline cost Select models by scenario
    Token usage Positively correlated with task length Trim context
    Cache hits Reduce repeated computation Design stable prefixes
    Retries / infinite loops Implicitly amplify consumption Set budget caps

    Therefore, cost should be evaluated based on the total cost of completing a unit of work, not simply by comparing unit prices.

    Conclusion: Build a Reusable Evaluation Framework

    This ten-million-token test produced three pleasant surprises—long-horizon autonomous coding, complex logical reasoning, and cache-driven cost reduction—and one unexpected finding: overthinking on simple tasks. For developers, the real takeaway is not a ranking of any particular model but an evaluation framework: use long-horizon tasks to test planning, difficult problems to test reasoning stability, simple questions to test overthinking, and total cost rather than unit price to measure economics. Including these four dimensions in the model-selection checklist makes it possible to make robust engineering decisions within a rapidly evolving model ecosystem.