Manuscript Offprint

arXiv:2609.37743

ContextRender: From Execution Dependencies to Agent Context

Savini Kashmira, Jayanaka L. Dantanarayana, Lingjia Tang, Jason Mars

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

LLM agents performing long-horizon tasks accumulate tool results that later steps may need. Passing the full history to every invocation is costly even when it fits within the context window, while reducing it risks omitting needed information. Existing context management methods can overlook how earlier tool results are used in subsequent execution, leaving needed information out of context. We introduce CONTEXTRENDER, which manages context through a persistent graph of execution dependencies. We develop Tool-Flow Analysis to track how later operations reuse information from earlier tool results, providing a signal called observed reuse. A renderer combines this signal with recency and semantic relevance to select results within a fixed history budget, retaining omitted results for later use. Across AppWorld and 8-objective QA with three execution models, CONTEXTRENDER outperforms the evaluated context management baselines using a 6K history budget, well below the models' maximum context windows. Within this budget, it achieves task performance close to or above that of passing the full history while reducing mean inference cost by 10.2%–32.2% relative to Full history. Ablations show that observed reuse improves task performance and retention of results reused later.

1 INTRODUCTION

Large Language Model (LLM) agents increasingly use tools to carry out complex, long-horizon tasks such as software engineering, deep research, and work across digital applications (Yang et al., 2024; Trivedi et al., 2024). Executing these tasks often requires an agent to make tens to hundreds of model calls and tool interactions, causing its interaction history to grow throughout execution. Information accumulated in this history may be needed again as the agent carries out later steps. However, carrying the entire accumulated interaction history forward at every invocation imposes substantial inference cost, can exceed the context window, and can expose the model to irrelevant context, adding noise to the current step (Liu et al., 2024; Zhang et al., 2026). Managing this history can reduce inference cost even when it fits within the model's context window.

To limit context growth, agent systems such as OpenClaw, OpenCode, and Hermes Agent provide mechanisms for managing accumulated interaction history (OpenClaw, 2026; OpenCode, 2025; Nous Research, 2026). When configured context-size thresholds are reached, the model-visible history can be reduced using techniques such as pruning and compaction. Pruning removes selected messages or tool results based on heuristics such as recency or size, while compaction replaces earlier interactions with a shorter summary (Kang et al., 2025; Lindenbauer et al., 2025; Sun et al., 2025; Ye et al., 2025; Dang et al., 2026). However, these operations may leave details from earlier tool results absent or incomplete in the model-visible context when needed later in execution (Figure 1, left). If the complete tool results are not retained elsewhere, recovering those details may require additional tool calls (Lindenbauer et al., 2025; Zhang et al., 2026).

More recent work has sought to preserve excluded information and improve context selection. Learned and optimized compression attempts to retain important details when earlier interactions are shortened (Kang et al., 2025; Sun et al., 2025; Ye et al., 2025), while retrieval-based memory preserves earlier information outside the model-visible context for later access (Packer et al., 2023). Adaptive and model-directed approaches adjust the visible context during execution. ACE selects

Figure

Figure 1: Comparison of context management approaches. CONTEXTRENDER selects history from a persistent graph using recency, semantic relevance, and observed reuse, retaining unselected results for later use.

raw, abstracted, or hidden historical steps based on the current task state (Liao et al., 2026), while PACE adjusts historical granularity according to predicted relevance to the next action (Wei et al., 2026). Sculptor provides model-controlled context editing and restoration (Li et al., 2025), and Self-GC uses a planner to propose folding, masking, and pruning operations (Hao et al., 2026) (Figure 1, middle). However, judging which information to expose remains difficult when an earlier result supports later operations in ways that are not apparent from its relevance to the current step. A result containing repeatedly used identifiers or other values may receive low priority even while those values remain useful. This motivates supplementing relevance judgments with evidence of how earlier results have been used during execution, helping identify which historical tool results to show at each invocation.

Our key insight is that context management should track execution dependencies rather than just maintain a chronological list of interactions, and use these dependencies to guide which earlier tool results are shown to the model at each invocation. These dependencies connect earlier tool results to later model steps and tool calls that reuse values those results introduced. Tracking these relationships captures how results are used as execution progresses, beyond when they were produced or how closely their content matches the current invocation. We call this evidence of use observed reuse. An earlier tool result may remain useful because subsequent operations continue to draw on its information, even when recency or semantic relevance gives it low priority. Context selection can therefore combine this evidence with recency and semantic relevance to retain or restore complete tool results at later invocations.

Building on this insight, we introduce CONTEXTRENDER, a context-management system that records execution history and detected reuse relationships in a persistent context graph, then selects which earlier tool results to show at each model invocation under a fixed history budget (Figure 1, right). CONTEXTRENDER has three components: (1) The persistent context graph stores messages, tool calls, and complete tool results while preserving their chronological order. (2) Tool-Flow Analysis (TFA) tracks how later model steps and tool calls reuse values from earlier tool results. It links each detected use to the tool result that first introduced the value and records this evidence as observed reuse. (3) A renderer combines observed reuse with recency and semantic relevance to select complete historical tool results within the allocated budget. Unselected results remain available in the graph for later invocations. Figure 3 illustrates the overall design.

We compare CONTEXTRENDER with baseline context-management methods using three execution models. Our evaluation shows that CONTEXTRENDER can achieve task performance close to or above passing the full accumulated history using a small history budget for including the agent's previous execution steps in context, well below the models' maximum context windows. At our primary 6K setting, CONTEXTRENDER consistently achieves the highest task performance among the evaluated managed-context baselines across two benchmarks, AppWorld (Trivedi et al., 2024) and 8-objective QA (Kwiatkowski et al., 2019; Zhou et al., 2025), with all three models. It achieves this performance while reducing mean standardized inference cost by 10.2%–32.2% relative to passing the full history. Our ablation study shows that adding observed reuse from recorded execution

Figure

Figure 2: Execution trace from an AppWorld task in which the agent settles a shared dinner bill among roommates. Information from the contact result produced at Turn 8 is used by later operations at Turns 9, 15, and 16. At Turn 18, the agent needs Nancy’s email address, which has not been copied forward and remains available only from the Turn 8 result.

dependencies to recency and semantic relevance improves task performance and retention of results reused later, with particularly large recall gains for results reused after long intervals.

This paper makes the following contributions.

  1. We introduce Tool-Flow Analysis (TFA), which tracks how later operations reuse information from earlier tool results, providing an observed-reuse signal for context selection.

  2. We introduce CONTEXTRENDER, which uses TFA and a persistent context graph to include earlier tool results in the model's context within a token budget allocated to history, while retaining omitted results for later use.

  3. We evaluate CONTEXTRENDER across two benchmarks with three execution models, demonstrating comparable or higher task performance while reducing inference cost by approximately 10%–32% relative to passing the full accumulated history.

References (56)