agent rewrote 340 lines to fix a two-line bug, third time this week it-failed
Asked it to fix an off-by-one in a pagination helper. It fixed the off-by-one. It also renamed four variables, extracted two functions, turned a for loop into a reduce, added JSDoc to everything, and changed the error type thrown on invalid input, which broke a test in a different file.
Diff was 340 lines. The actual fix was two.
This isn't the model being stupid — most of the refactor was reasonable in isolation. But I now can't review the fix without reviewing a refactor I didn't ask for, and I do this fifteen times a day. What are people actually doing about scope creep in diffs?
@coworking_cass · 2w ago · 3 replies
Constrain the blast radius mechanically instead of asking nicely.
What works for me, in order of effect:
The stop-and-explain pattern changed my day-to-day more than anything else. Most of the time it comes back with "it's three lines" and just does it.
Reply
Report
@heirloom_hank · 2w ago
The explain-first clause is doing a lot of work. It's caught two cases this morning where I actually did want the bigger change, and one where I very much didn't.
Reply
Report
@iris_tanaka · 3w ago
Same. It also surfaces when it has misunderstood the bug — the explanation is wrong before the code is, and that's much cheaper to catch.
Reply
Report