CTO AI Corner: When AI gets stuck – teaching agents to debug themselves

Do you remember when developers would spend days wrestling with a cryptic bug, making zero progress and developing a close personal relationship with the rubber duck? AI gets stuck in a similar way. It pokes at things at random, occasionally fixes one issue, and quietly breaks three others while trying to get unstuck. As agents become more autonomous and run longer tasks, this may be one of the most important problems to solve. Otherwise, a lot of compute and time is spent jogging in circles.

A root cause is the lack of perseverance and systematicality. The system chases quick wins, tries to patch the most likely cause without first validating the problem or building a proper understanding. That often works, until it doesn’t. When it fails long enough it cannot pivot to a more methodical approach. Eventually it gives up and proposes a different path to the goal, even though the original route was fixable.

Adding a layer of supervision

When I supervise an AI closely, I can ask it to stop and draft a plan for identifying and verifying the problem. With long-running agentic jobs, I still have not found a satisfying way to enforce that discipline.

My current mental model is a watcher agent that oversees the worker. If the worker spends too long or racks up too many failures, the watcher pauses execution. The system then switches to a verification phase where it only adds instrumentation, collects logs, and runs tests. No fixes. Once the failure is reproduced and the cause is verified, we apply the change and let the worker resume. Even when the fault is a compound issue, this approach should peel problems off one by one.

October 2, 2025
ai-corner
Authors
Tomi Leppälahti
CAIO & CTO
Share

Pohdituttaako AI-​​​​​​​asiat? Jätä viesti ja kartoitetaan yhdessä, miten ja missä hyödyntää tekoälyä.

Kiitos viestistäsi! Olemme pian yhteydessä.
Hupsis! Jotain meni pieleen lomakkeen lähetyksessä.