← Latest papers
🤖 machine learning

The Working Set of a Coding Agent: Coherence Debt in Repository-Scale Tasks

This paper introduces the concept of "coherence debt" to demonstrate that repository-scale coding agent success depends primarily on the immediate availability of required contextual facts rather than their distance or the agent's parametric memory, revealing that agents often fabricate solutions when facts are missing and that current evaluation harnesses may misdiagnose failures by focusing on read operations rather than the consistency of generated outputs.

Original authors: Bardia Mohammadi, Lars Klein, Aman Chadha, Akhil Arora, Laurent Bindschaedler

Published 2026-08-18
📖 7 min read🧠 Deep dive

Original authors: Bardia Mohammadi, Lars Klein, Aman Chadha, Akhil Arora, Laurent Bindschaedler

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

In the world of software, a single line of code rarely exists in isolation. To change a number in one file, a programmer often needs to know how that number is used in three other files, what configuration settings control it, and which tests must pass to prove the change is safe. This web of connections is what makes fixing a bug or upgrading a system difficult; the correct answer depends on facts scattered across the entire project. For years, researchers have tried to build artificial intelligence agents that can navigate these complex webs, acting like junior developers who can read a whole codebase, understand the rules, and make the right edits. The hope has been that if we give these AI agents enough information about the project, they will succeed. But a new study suggests that simply giving the agent more information is not the whole story. The real challenge is not just having the facts available, but having the right facts available at the exact moment the agent tries to write a new line of code.

Researchers from several institutions, including the Max Planck Institute for Software Systems and EPFL, set out to test exactly how these AI agents handle the flow of information during a coding task. They treated the project like a living system where the agent must constantly keep a "working set" of facts in its mind: the current test requirements, the names of imported tools, and the rules for how the software should behave. They asked a simple but profound question: what happens when a necessary fact is missing from the agent's view? Does the agent stop and ask for help, or does it guess? And does it matter if the fact is right next to the edit or buried deep in a long list of previous instructions?

To find the answer, the team created a series of controlled experiments. They built fictional software libraries with specific rules that no AI had ever seen before, ensuring the agents could not rely on memorized knowledge. They then ran the agents through migration tasks, such as updating a library from one version to another, under different conditions. In some runs, the agents were given the task description but no access to the code or the rules, forcing them to rely entirely on what they had learned during their training. In other runs, the researchers provided the exact rules and source files right at the start. They also tested what happened when they deliberately hid specific pieces of information, like a secret value needed to calculate a result, to see how the agents reacted.

The results were stark and clear. When the agents were denied access to the necessary facts, they did not simply stop working or admit they were stuck. Instead, they continued to act, often with dangerous confidence. If a file was missing, the agent would invent a new one. If a value was unknown, it would guess a number. The agents produced "wrong work" rather than "absent work." They fabricated files and guessed values, creating code that looked complete but was fundamentally broken. This behavior meant that standard tools used to measure an agent's success, which often just check if the agent read a file, were misleading. An agent could read a file it wrote itself, or read a file that was irrelevant, and the tools would count it as "doing the work," even though the agent had missed the crucial fact it needed.

The study also revealed that the location of the information did not matter as much as its presence. The researchers tested whether it made a difference if a required fact was placed at the very beginning of a long list of instructions versus right next to the place where the edit was being made. They found that as long as the fact was present in the agent's view, it could be used just as effectively whether it was at the start or the end of a massive context window. The distance did not degrade the agent's ability to use the fact. However, if the fact was completely withheld, the agent failed, regardless of how much other information it had. The damage was linear: hiding one fact caused the agent to fail on the specific tasks that depended on that fact, but it did not cause a cascade of failures in unrelated parts of the code.

Perhaps the most surprising finding concerned the agents' ability to admit they were blocked. The researchers found that whether an agent would say "I cannot proceed because I am missing a file" depended entirely on which specific AI model was being used. Some models, like one called Opus, reported being blocked in every single trial when a file was missing. Others, like Codex, never reported being blocked; they simply fabricated the missing file and continued. This suggests that the ability to recognize a gap in knowledge is not a universal feature of coding agents but a specific trait of the model itself. For the systems that do not admit they are stuck, the "coherence debt"—the gap between what the agent needs and what it knows—remains invisible until the final code is checked and found to be wrong.

The researchers also discovered that the way a coding task is organized matters more than the sheer volume of information. When they split a tightly connected task across multiple agents, the success rate dropped because the agents could not keep the shared facts consistent. But when they split independent tasks, the agents worked just as well. This confirmed that the problem is not just about having enough data, but about keeping the specific facts that are linked together available at the same time. If an agent is asked to change a setting in one file, it must have the current value of that setting and the rule for how it interacts with other files in its immediate view.

Finally, the study looked at what happens when the information available to the agent is contradictory. In some experiments, the researchers provided a written standard document that said one thing, while the existing code in the project demonstrated the opposite. In every single case, the agents followed the written standard, even when the standard prescribed a worse or more error-prone way of writing the code. This suggests that for these AI agents, a written rule carries more authority than the actual behavior of the software it is supposed to describe. If the standard is outdated, the agent will faithfully reproduce the outdated rule, making a stale document more dangerous than having no document at all.

The implications of these findings are significant for how we build and evaluate AI coding tools. It turns out that simply making the context window larger or giving the agent more memory does not guarantee success. The critical factor is ensuring that the specific facts an agent needs to make an edit are present and consistent at the moment it writes. If an agent is missing a fact, it will not wait; it will guess. And if the facts it is given are contradictory, it will follow the written rule, even if that rule is wrong. The study concludes that the best way to build these systems is not just to feed them more data, but to design the environment so that the necessary facts are always available and up to date, and to check the agent's output against what it actually produced, rather than assuming it read the right things. The agents are not failing because they are too small or too slow; they are failing because they are too eager to fill in the blanks when the facts are missing.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →