Google Finds that Technical Debt Can Derail Coding Agents Through “Agent Distraction”

MMS Founder
MMS • Sergio De Simone
Article originally posted on InfoQ. Visit InfoQ

In a recent article, Google senior staff software engineer Sam Saccone and senior staff data scientist Madhuri Garikapati highlighted the cost of agent distraction, where AI coding agents get derailed by stale technical debt, such as old TODO comments, obsolete bug references, and outdated specs, leading them to embark on unrequested “side-quests”.

Obsolete specs, long resolved bugs, and lagging documentation no longer rest in long forgotten corners of the codebase, but rather are unintentionally ingested as context indirecting and misdirecting the next wave of coders – the agents.

According to the authors, at best, agent distraction increases token consumption and execution time; at worst, it can lead agents to “incorrect logic and decisions”. To investigate this impact, they focused on TODO(bug/...) comments, which, as they note, “tend to be left behind long after the underlying bug is resolved or abandoned”.

By cross-referencing every TODO an agent encounters against the TODO’s bug status and the user’s prompt, we can automatically separate valid work from wasted detours at scale.

Using distributed traces from thousands of engineers and hundreds of millions of agent steps, Google found that approximately 13% of sessions exposed agents to inline TODO/FIXME references, leading agents to take action targeting the reference bug in 6% of those cases. In most cases, the prompt did not even mention the referenced bug. Furthermore, in 41% of these unprompted detours, the agent worked on tickets that were already closed; in 57% of them they worked on bugs that were still open, but fell outside the scope of the developer’s request, which the investigators classified as “scope creep”.

Using a multi-way fixed-effects regression with developer-clustered standard errors, the investigators found that these detours add substantial overhead per session, with 70% more steps, 77% more tokens, and 105% more wait time.

To address this issue, Google developed scanner agents to identify and clean up obsolete TODOs across the codebase. In some cases, the agents had to inspect years of git history to be able to confirm that both the TODO and the intent behind it were obsolete. However, only once confirmed this, they submitted a PR to remove the outdated reference from the codebase.

As a result of this multi-layer approach, our todo cleaner has been able to remove thousands of actually obsolete references over the last 6 months exceeding 95% acceptance from human reviewers.

The investigators conclude that tools such as presubmit analyzers, codebase scanners, and automated agents can help mitigate “agent distraction” and thus improve the effectiveness of AI coding agents.

Commenting on the finding, X user Tulasiram noted that “this is a useful reminder that comments are context too“. Ryan White emphasized:

This is just junior dev behavior at machine speed. Leave a misleading comment and someone chases it for a day. Except now it happens 40 times an hour and you’re paying for the tokens.

On LinkedId, user Awais Raza expressed optimism about the potential to mitigate agent distraction:

The 95%+ human acceptance of the todo cleaner is telling: it shows cleanup can be automated without losing human judgment.

Finally, Muhammad Zohaib extended this perspective, pointing out that “the same probably applies to websites: outdated pages and conflicting info make it harder for AI systems to pick the right answer.”

About the Author

Subscribe for MMS Newsletter

By signing up, you will receive updates about our latest information.

  • This field is for validation purposes and should be left unchanged.