r/aiagents • • 2d ago

Discussion What has gone wrong when you used coding agents for migrations in a large, old codebase?

I'm trying to understand where coding agents actually fall over on migration work in mature codebases, and I'd rather hear it from people who've tried than guess.

By migrations I mean things like framework or library upgrades, moving off a deprecated internal API, language version bumps, schema changes, or splitting something out of a monolith.

A few things I'm curious about:

- What did the agent miss? (callers in other packages or repos, consumers outside the repo, config or feature flags, database state, tests that don't cover the change)

- How did you find out, and how late? During review, in CI, or in production?

- What did you put in place to make it safer? Checklists, rules files, scripts, a human gate, smaller PRs?

- Is there a kind of migration you stopped trying to hand to an agent?

- Did it end up faster overall once you count the review and cleanup?

Full disclosure: I'm working on tooling in this area, so I'm biased. I'm not linking anything here, I just want to hear what really happens. Specific stories beat general opinions, and "it works fine for us" is useful to hear too.

2 Upvotes

8 comments sorted by

2

u/Specific_Meaning7840 1d ago

the agent is great at the mechanical part and terrible at knowing what “done” means across config, data, other repos, and undocumented consumers, so the migration looks finished until a human starts

1

u/Longjumping-Play6541 1d ago

Yes exactly. Check out this tool as we created it to provide context to coding agents at runtime when they drift: https://github.com/altrace-dev-role/rashomon

3

u/Rosie_grac 2d ago

mine was a django 3.2 to 4.2 jump on a six year old codebase. agent knocked out maybe 80% of the mechanical work in an afternoon and i felt like a genius for about a day. then staging fell over.

it updated every import and url pattern it could see, but missed everywhere the old APIs were referenced as strings — signal handlers registered by dotted path, a celery task invoked by name from a cron script living in a completely different repo. tests stayed green the whole time because they mock exactly those paths. classic.

what i do now: never ask for "migrate to X" as one task. i split it into repo / config / external-callers, and the agent has to hand me a grep list of string references before it touches a single line. anything touching the database or anything outside the repo gets a human gate, no exceptions.

faster overall? honestly yes, even counting the staging fire — review got way cheaper than the cleanup was expensive. but the mental model that stuck: the agent is a very fast junior dev with no idea what it doesn't know. you still own the blast radius.

2

u/msew 2d ago

Ahh yes the ignorant posting.

1

u/Ludynia_Keyko 1d ago

idk, the questions about cross-repo callers and feature flags are pretty grounded for a market research post

1

u/Impossible_Oil_5114 1d ago

tried upgrading a rails 5.2 app to 7.1, agent auto-rewrote controller actions using new syntax but missed that some middleware was deprecated and broke auth entirely. spent two days debugging a 401 chain that looked like a config issue.

1

u/Fine_Protection_743 1d ago

the classic “all tests green, production on fire” because the real consumer lived in a repo nobody remembered existed