Hands-On with Long-Running LLM Agents: Lessons from 10 Million Tokens

    This article shares findings from a hands-on test of long-running LLM agents that consumed over 10 million tokens across three scenarios: long-horizon agentic coding, complex logical reasoning, and lightweight everyday Q&A. It explains why long-horizon tasks reveal capabilities that short tests miss, such as context management, self-correction, and tool-call stability. Readers will learn how models plan before coding, sustain autonomous work, and where they struggle, plus practical guidance on plan-first execution, reasoning circuit breakers, model routing, and cost control through context caching.

    1. Test Background and Methodology

    This hands-on test consumed more than 10 million tokens in total and covered three typical scenarios: long-horizon agentic coding, complex logical reasoning, and lightweight everyday Q&A. The setup connected an LLM to an AI coding tool and let the model autonomously complete a closed loop of planning, coding, and verification, with human review only at key checkpoints.

    Note that this article does not target any specific vendor or product. All conclusions come from observations at a general capability level and are intended to help developers judge what current LLMs are and are not suited to handle.

    The 10-million-token scale was chosen deliberately: short tests only reflect single-turn answer quality, whereas long-horizon tasks expose the capabilities that truly affect engineering usability, such as context management, self-correction, and tool-call stability.

    2. Key Takeaways

    1. Long-horizon autonomous execution has improved markedly: the model can work autonomously for tens of minutes without interruption, completing a full flow from database design to feature implementation and self-verification.
    2. Complex reasoning shows promise but is unstable: the model performs well on situational reasoning, but can fall into loops or reach wrong conclusions on hard math problems and some minimal tests.
    3. Lightweight tasks are where things can go wrong: on simple questions, a strong reasoning model may overthink and produce a worse answer, while a lightweight model is more direct and efficient.
    4. The cost structure has shifted: unit prices have risen, but cache reuse in long tasks can significantly dilute the growth of the actual bill.

    3. Long-Horizon Agentic Coding: From Code Completion to Delivering an Engineering Skeleton

    3.1 Task Design: Goals Only, No Constraints

    We intentionally used low-constraint prompts, describing only the business goal (for example, building a system with bookkeeping and transaction-statistics capabilities) without prescribing the table structure, module breakdown, or verification method. The purpose was to assess the model’s autonomous planning ability rather than its instruction-following ability.

    3.2 Observation 1: Plan First, Then Act

    Before writing any code, the model produced a complete plan: it split out several core feature modules, designed the core data tables, and additionally listed a verification checklist. This is critical in engineering terms—forming a checkable plan first gives later execution a traceable anchor.

    3.3 Observation 2: Continuity of Long-Horizon Execution

    With a completely hands-off approach, the model coded autonomously for nearly 60 minutes without interruption, loops, or omission of key steps, and largely adhered strictly to the earlier plan. This shows that current models already have an initial “task retention” capability: maintaining goal consistency across a long context.

    3.4 Observation 3: Weak on Aesthetics, Strong on Functionality

    The output was lacking in interface aesthetics, but the core functionality worked properly. This suggests that at the current stage, LLMs should be placed in the role of “feature implementation and skeleton building,” while visual and interaction polish should still be handled by humans or a dedicated process.

    3.5 Engineering Recommendations

    • Constrain the model with “plan first”: require it to output a module list and an acceptance checklist before execution.
    • Set up staged commits and rollback points to avoid a long run polluting the codebase all at once.
    • Automate the verification checklist into test scripts, generated by the model and executed by the pipeline.

    Illustrative flow:

    1. Goal input -> Plan and acceptance checklist -> Module-by-module implementation -> Automated tests -> On failure, roll back to the latest commit

    4. Complex Reasoning: Stability Matters More Than Peak Performance

    The test showed that the model performed excellently on situational logic reasoning, able to grasp implicit conditions and complete multi-step deduction; but it fell into loops or produced wrong answers on hard math problems and some minimal tests.

    The engineering implication is direct: reasoning ability has “variance.” Production systems cannot rely on a single reasoning result and must introduce external constraints:

    • Require verifiable intermediate steps for key conclusions;
    • Set a maximum number of reasoning steps or a timeout circuit breaker to avoid infinite loops;
    • Connect external calculation tools or validators for math and numerical tasks instead of relying entirely on the model’s mental math;
    • Use multiple samples and consistency checks, taking the majority-consistent result.

    5. The “Overthinking” Problem in Lightweight Tasks

    A typical phenomenon is that on simple questions, the strong reasoning version sometimes gives a wrong answer by weighing options repeatedly, while the lightweight version is more direct, faster, and cheaper. This is not a capability regression, but a mismatch between the reasoning budget and task complexity.

    The practical recommendation is to build a routing layer: first determine task complexity, then route to models of different tiers.

    1. if task complexity == low: use a lightweight model
    2. elif long-horizon tool calls are required: use a strong reasoning model + plan constraints
    3. else: use a general model + consistency checks

    6. Cost Perspective: A Higher Unit Price Does Not Mean a Proportionally Higher Bill

    In long-horizon tasks, a large amount of context is repeated system prompts, historical plans, and code snippets. If the platform supports a context caching mechanism, the repeated parts can be reused, and the actual billing increment will be clearly lower than the unit price increase. Therefore, cost should be evaluated by “total task cost” rather than unit price alone.

    General measures that can help include: streamlining system prompts, compressing historical context, returning only necessary file snippets, and splitting long tasks into multiple stages with reusable prefixes. On the cloud side, you can combine object storage to save intermediate artifacts, and logging and monitoring services with alerts to track token consumption.

    7. Implementation Checklist

    1. Long-horizon tasks must “plan first + staged commits.”
    2. Reasoning tasks must have “circuit breaker + validation + multiple samples.”
    3. Prefer lightweight models for simple tasks and set up routing.
    4. Evaluate cost per task, and make good use of caching and context compression.
    5. Human-machine division of labor: the model handles the skeleton and functionality, humans handle aesthetics and key decisions.

    8. Conclusion

    The core judgment from the 10-million-token test is that LLMs have evolved from a “code completion tool” into an “executor that can deliver an engineering skeleton,” but their reasoning stability and task-complexity matching still need to be backed by an engineering system. Only by placing the model in a process with constraints, validation, and rollback can long-horizon capability truly be turned into productivity.