Why AI coding agents still miss the lines that fix bugs
Neutral AI coding By What The Future Newsroom · June 14, 2026 · 4 min read

Why AI coding agents still miss the lines that fix bugs

SWE-Explore tests the search stage of AI coding agents separately from the final repair. The benchmark shows that agents often identify the right file, but they capture only 14 to 19 percent of the relevant code lines on average.

AI coding agents are getting better at navigating software projects, but a new benchmark points to a stubborn weakness: finding the file is not the same as finding the code that matters. SWE-Explore separates the search phase from the actual bug fix, making it easier to see where an agent loses the thread before it ever writes a patch.

“This is mainly a technical benchmark about current AI coding-agent limitations, with only a mild dependence/quality concern.”Why it scores Neutral

What SWE-Explore Measures

Most AI coding benchmarks focus on the end result. The central question is usually simple: did the agent fix the bug or not? That can be useful, but it hides the reason behind failure. An agent may fail because it never examined the relevant code, or because it found the right area and still made the wrong change.

SWE-Explore is designed to isolate that first step. The agent receives a bug description and a software project, then returns a ranked list of code sections it believes are relevant. The benchmark does not start by judging the final patch. It asks whether the agent gathered the right context before the repair attempt.

An international research team involving Shanghai Jiao Tong University built the benchmark around 848 problems. The dataset draws from 203 open-source projects across ten programming languages. Python accounts for 547 of 848 tasks, followed by Go, JavaScript, and Rust.

How The Reference Set Was Built

Identifying the exact code sections that matter is difficult to do manually. The team instead used successful solutions from strong AI models as a guide. For each problem, at least two successful solution attempts exist from models such as GPT-5.4, Gemini 3 Pro, Claude Sonnet 4.6, or Kimi K2.6.

The researchers looked at which files and lines those successful runs examined before the bug was fixed. When multiple independent solution paths focused on the same passages, that overlap became evidence that the code was useful context. The passages were not treated as absolutely required in every case, but they were strong indicators.

The process did not stop there. A separate verification step added individual key passages, and the team manually reviewed each region again. That gave SWE-Explore a way to compare agent search behavior against code regions that were linked to successful repairs.

Agents Beat Keyword Search, But Only Up To A Point

The benchmark compares traditional search methods with five general-purpose coding agents, including Claude Code, Codex, and OpenHands. It also includes four research systems built specifically for code search.

Traditional keyword search performs poorly. In one case study, a bug description containing "RuntimeWarning on Overflow" led search toward project templates and documentation because those terms appeared there more often than in the relevant source code. AI agents perform better because they search step by step rather than simply sorting all matching results at once.

That advantage matters. Agents are generally able to reach the right source file, rank it early, and keep the selection focused. At the file level, the systems look competent.

The problem appears when the benchmark zooms in from files to individual lines. General coding agents cover only 14 to 19 percent of the lines that actually matter. In other words, they often get to the right neighborhood but fail to inspect enough of the crucial addresses.

Stronger Models Do Not Remove The Gap

The team also tested whether the weakness could be solved by swapping in a more capable language model. The same agent was run with six different models from OpenAI, Anthropic, Google, Moonshot, and Zhipu. The GPT family leads, but the broader pattern remains: file hit rates stay much higher than line-level coverage.

Different agent architectures also end up close to one another. Claude Code, Codex, OpenHands, Mini-SWE-Agent, and AweAgent post nearly identical scores across every metric. That suggests the issue is not limited to one product or one agent design.

CoSIL is the standout. The research system scans code as a network of interconnected building blocks and achieves much higher line coverage. Among specialized localization systems, AutoCodeRover is precise but conservative, while OrcaLoca produces little noise but misses many relevant spots.

Why Missing Context Hurts More Than Extra Code

The most practical part of the study is its controlled ablation experiment. The team artificially changed how much context the repair model could see. The model received 0, 25, 50, 75, or 100 percent of the core regions, sometimes with irrelevant non-core code added.

For the easier tasks in the dataset, the result shows a threshold effect. When less than half of the necessary core regions are visible, repairs mostly fail. Success does not rise smoothly with every extra clue. It jumps between 50 and 75 percent coverage.

For harder tasks, the effect is narrower. If the problem is already beyond the model's ability, more context does not help much. But when the task is within reach, missing the important lines can be enough to block the fix.

The experiment also shows that irrelevant extra code is less damaging than missing critical code. Once the important regions are available, added non-core code barely gets in the way. For future AI coding agents, the implication is direct: systems may need to read more broadly instead of filtering too aggressively.

The study arrives as broader AI coding benchmarks face more scrutiny. SWE-bench, created about two years ago, tests AI coding agents against real GitHub issue reports and has led to many variants. But final-result scoring can conceal basic problems. A study by the research organization METR found that project managers would reject about half the solutions the automated reviewer accepted, many because of basic functional errors.

SWE-Explore does not replace end-to-end repair tests. It explains one reason those tests can fail. If an AI coding agent misses most of the relevant lines, the final patch may be weak before the model begins writing it.

← Back to the wire

Read next