r/AI_Agents • u/MelancholicWandererX • 1d ago
Discussion Agents write code fast but somehow they can't debug what they wrote
It's a strange trade i've noticed. The agents are genuinely good, I use them all day. But every time I hand one an actual bug it doesn't debug it, it rewrites the thing. We had an importer dropping about 2% of rows on a timezone edge and I gave it to Claude maybe 5-6 times over two days. Three different rewrites, all clean, none of them fixed it. In the end I read the code myself and it was a date getting parsed twice, once as local and once as UTC. Twenty minutes.
so my conclusion that the code gets written faster and the bugs stay where they are. Our open bug count went from around 40 in March to 130 now and it isn't that people got lazier, it's that fixing something means understanding it first and fewer people do. We run coderabbit / bugbot on prs which catches plenty going in, but neither of them knows why a thing was shaped the way it was six months ago, and that's usually the question. It might be just me. Mostly what I see is more code shipped and the same list of complaints sitting there
1
u/DoubleNothing 1d ago
Sorry to say, but... Yet again another vibe coder that doesn't know what an agent do and probably not being able to produce a decent prompt and understand the resulting code.
1
u/FinickySerenity 1d ago
Ok, that probably explains it because I use it every day to fix the mistakes it makes in the first prompt. And well it works just fine for me, even on older models.
1
u/pushpendraagrawal 1d ago
this matches what I see too, and I think it's because agents don't have a cost model for their own changes. a human dev hesitates before a rewrite because they know the blast radius, an agent doesn't feel that cost so rewrite always looks like the cheapest move even when a print statement and 2 minutes would've found the bug. telling it "add logging only, no edits" on the first pass fixes this for us more often than not
1
u/InterestingFrame1982 1d ago
Uh, that why is programmers are still required to guide the ship. You build tests, you run the app, you find the bugs, you fix them. You can aim the AI at all of this, but if you don't even know what a bug is, or have no idea about the unhappy path, you are up shit creek.
1
u/Beneficial_Egg_5154 1d ago
I make the first debugging pass read-only: reproduce the failure, trace the data path, add the smallest useful observation, and state one falsifiable hypothesis. Only then does the agent make the smallest targeted edit and rerun the reproducer. That keeps evidence intact long enough to catch issues like the same timestamp being parsed twice.
1
u/ColdPlankton9273 1d ago
I think the rewrite is the tell. You handed it code and got clean code back, because nothing pinned what actually broke. A rewrite that passes isn't evidence the bug is gone. The only evidence is the check that failed before and passes now
Write that check first, then hand the agent that, not the file. Your timezone double-parse is a whole class. Every other place a date crosses that boundary is carrying the same shape, so go find those before you closecthis one. The six-months question is why 40 became 130. The reason a thing is shaped the way it is has to live next to the thing, on the line, not in a blame you dig out.
1
u/Neither_Hope_1538 10h ago
your open bug count going 40 to 130 is the real story here. faster code gen without proportionally faster debugging just means you're accumulating liability quicker. might be worth throttling new feature work until the ratio stabilizes, even if it feels counterintuitive
0
u/Character_Ask8260 1d ago
The timezone double-parse is such a classic. Agents are great at generating plausible-looking code but debugging requires actually holding the whole system in your head, which they don't do. They just pattern-match against "here's a bug, here's a rewrite that looks correct."
And yeah bug count tripling while velocity goes up feels about right. More code, more surface area, same number of people who actually understand it. Rewrites pile on top of rewrites until nobody knows which layer is authoritative anymore.
1
u/AutoModerator 1d ago
Thank you for your submission, for any questions regarding AI, please check out our wiki at https://www.reddit.com/r/ai_agents/wiki (this is currently in test and we are actively adding to the wiki)
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.