We have observed a counterintuitive fact: as the context window—the short-term working memory of an AI system—expanded from 32K to 128K, the failure rate of Agents on long-running tasks did not decline. The problem is not that the model has become less capable. Nobody is managing the “garbage collection” of its working memory. Tool results, retrieved passages, and stale plans pile up until critical evidence is pushed out. A technical article on Juejin proposes an engineering solution called a “context ledger.”

What this is

When an Agent handles a long-running task, a single session may involve dozens of tool calls, web scrapes, and large volumes of code. Over the past year, every major model company has raced to expand context windows—from 8K and 32K to 128K. But a context window is not an infinitely expandable chat history. It is closer to a hybrid of runtime memory, an evidence repository, and a task log. Without lifecycle management, any window—no matter how large—will eventually be clogged with low-value tool output, duplicate retrieval results, and debugging information.

The article’s solution is to give the Agent a “context ledger.” Every piece of information entering the window is recorded with five attributes: where it came from, its current utility, when it expires, what risks it carries, and whether the original text, a summary, or only a citation should be retained. Before each inference, the model does not simply append the latest N messages. Instead, it selects only what it needs from the ledger. For example, the user’s original objective is marked non-evictable; failed tool results receive a risk label and are excluded by default; and large documents are represented by pointers, with their contents reread only when necessary.

Industry view

This is not a single voice. In its 2026 practice guide, Sourcegraph elevated “context engineering”—the design of what a model can see during each inference—to a standalone topic. LangChain, meanwhile, breaks the strategy into four operations: writing, selecting, compressing, and isolating. These two companies represent two major strands of the Agent framework market—one focused on developer IDEs and the other on general-purpose applications—and both identified context governance as the top engineering problem in 2026.

Some teams remain cautious. One objection is that a ledger merely moves complexity from the model layer to the engineering layer; it does not fundamentally change the fact that long-task Agents tend to drift off course. Another concern is that building such a framework in-house creates a significant engineering burden for small and midsize teams, potentially slowing product delivery. Both criticisms are worth keeping in mind. An elegant technical solution does not mean that an off-the-shelf product is available today.

Impact on regular people

  • For enterprise IT: When evaluating or purchasing Agent products, ask vendors a specific question: How do you handle context bloat during long-running tasks? Do you have an automatic disposal mechanism?
  • For individual professionals: At this stage, there is no need to worry that “AI employees” will replace you. But it is worth recognizing that the Agents capable of reliably completing long-running tasks are the ones that can truly enter the workplace. Systems that manage only ten rounds of conversation offer more hype than practical utility.
  • For the consumer market: Consumer AI assistants for chat and writing will not adopt heavy-duty ledger systems in the short term. For “AI employee” products costing several thousand yuan per year, however, context governance will directly determine whether the product remains useful for an entire year.