Manuscript Offprint

arXiv:2610.05281

When Agent Context Goes Stale: Incoherence in Volatile Agent Context

Yingying Liu, Junzhou Fang, Chenxiong Qian

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

Abstract

Modern agents increasingly ground their reasoning in observations returned by tools, such as file contents read from a workspace. However, the data sources underlying these observations may later be modified by users, other agents, or external tools, while the model retains only the stale content in its context window. Existing agent runtimes provide little support for notifying the model that a previously observed fact has become stale, causing agents to reuse outdated observations and make incorrect claims about the current workspace state.

We propose CONCORD, a context coherence framework that maintains the consistency between tool observations in agent context and the mutable sources from which they were derived. CONCORD links each observation to its source, detects source changes, and uses configurable handling policies to update, annotate, or suppress stale context before reuse. CONCORD is applicable across different agent runtimes and external resources, and can be easily extended to new runtime-resource settings. We implement CONCORD as a general framework, and instantiate a concrete use case to assess its effectiveness. We construct ConcordBench, where previously observed file contents become stale after subsequent edits. Across three evaluated frontier models, CONCORD produces answers consistent with the restored workspace state in all evaluated cases under these constructed conditions, matching the oracle on recover count for this benchmark, while using 46.4% fewer tokens than the strongest non-oracle baseline.

1 Introduction

AI agents are increasingly used as tool-using systems that interact with external resources during task execution. Modern agent runtimes, such as OpenClaw [14, 15], OpenCode [16, 17], and OpenHands [26] support built-in tools and extensions based on the Model Context Protocol (MCP) [2] for reading files, executing commands, querying services, and accessing remote resources. As a result, an agent's context is no longer limited to the initial user prompt or multi-turn dialog history, but also includes tool observations produced during execution. These tool observations are typically stored as structured execution entries and later projected into LLM messages before each model call.

Tool observations, however, are not live views of external resources. They are snapshots produced at a particular point in the agent's execution, while the resources they describe may continue to change outside the agent's view. For example, in multi-agent systems [9], one agent may update a file that another agent has already read; a developer may manually revise a configuration during an agent run; or a database queried through an MCP tool may be modified by an external transaction. If the agent runtime preserves earlier tool results as reusable context without tracking whether their source data has changed, stale observations may continue to be presented to the model as current facts, leading to incorrect actions or hallucinated claims about the environment.

Existing work addresses related consistency problems at either the workspace or retrieval level. Workspace-level systems reduce conflicts through write validation, isolated workspaces, synchronization, or snapshot reconstruction [5, 12, 20, 21, 29]. Memory and retrieval systems use freshness-aware updates, conflict detection, provenance, or temporal supersession to decide which stored or retrieved evidence should be used for generation [8, 13, 24]. These approaches show the importance of freshness and consistency, but they do not repair tool observations after those observations have already been materialized inside an agent's private prompt context. Consequently, obsolete observations can remain in later prompts and continue to shape model reasoning after their sources have changed.

Our approach. To address this gap, we propose CONCORD, a context coherence framework that maintains the consistency between tool observations in agent context and the mutable sources from which they were derived. At its core, CONCORD uses a runtime- and source-agnostic Context Manager, which tracks tool observations independently of any particular agent framework or external resource. Runtime Adapters connect the manager to different agent runtimes, while Source Adapters capture changes from different mutable resources. CONCORD is therefore easy to extend to new runtimes, tools, and resource types.

We make the following contributions:

  • We identify and formally define incoherence in volatile agent context as a coherence problem in tool-using agents, where context entries may lose consistency with the mutable external sources.

∗^{*}Yingying Liu and Junzhou Fang contributed equally to this work.

†^{\dagger}Corresponding author

Figure

Figure 1. A stale-observation failure in an agent-maintained workspace. After the agent records an old free-shipping threshold in its context, the configuration file is edited outside its view. The agent later answers from the stale observation, producing an answer that contradicts the current workspace state.

  • We introduce CONCORD, a runtime- and resource-agnostic framework that tracks source-linked context blocks, detects source changes, and reconciles stale observations through configurable policies.

  • We instantiate CONCORD for local file resources and evaluate it on a HotpotQA-derived race benchmark across three frontier language models. Under the constructed race conditions in the 40-task ConcordBench-Pioneer, CONCORD achieves a recover count of 40/40 for each evaluated model, matching the oracle recover-count upper bound on this benchmark while using fewer tokens than the evaluated non-oracle baselines.

References (20)