Benchmarking Coding Agents on New vs Legacy Codebases — Denys Linkov, Wisedocs
AI Engineer · 18 min · 210 sentences · from YouTube's caption track
Each timecode opens YouTube at the start of that sentence. Line anchors (#s42) are the cue ids in the WebVTT, and every line carries its start and end seconds. All transcripts has every talk, and the whole corpus as one file.
- 00:01[music]
- 00:12So, it's not just my AI pipeline that's on fire, but also my PowerPoint.
- 00:15So, it's 2025.
- 00:17Uh we're scaling as a business and things are going poorly.
- 00:20We're adding too many customers, we're not getting the throughput we need, and we need to improve our underlying technology.
- 00:27And there's three main issues that we're facing.
- 00:30The first one is that we're too slow to meet customer demand.
- 00:33The second one is that this AI pipeline that we've built is too complicated to update.
- 00:37And the third one is because it's a legacy code base, or actually more than 10 repos, nobody actually wants to touch the code.
- 00:42It's not a fun experience.
- 00:45So, we made this decision to refactor over the course of 6 months.
- 00:49And the real question for this talk today was, "Is this the right move to do?"
- 00:54So, I'll spend this time answering this question, but let's start off with the use case.
- 00:57So, the company I work at, WiseDocs, processes complex medical claims, which are PDFs that are more than 10,000 pages in size.
- 01:04Some of these files are bigger than video files.
- 01:06So, it's a pretty complex application, and because of this, it's actually non-trivial to scale the different parts.
- 01:12So, we're going to talk about the pipeline today, which has a number of ML models.
- 01:17So, I'll divide this talk into a number of chapters.
- 01:18We'll start off with the first one, which is the concept of tech debt.
- 01:23So, I think we all have this feeling universally, if we've been developers for a while, that we all write bad code.
- 01:28The question is, do we do this intentionally or not?
- 01:31If I look back to some of the earliest code I used to write, uh it was bad.
- 01:35This was more than 15 years ago.
- 01:36I tried to print an image of this character from a video game, and I didn't understand that you can't uh system.out.println in Java to render something on the screen.
- 01:46So, hopefully I've come uh further from that point in time, but there's these moments where we all know that we've written bad code before.
- 01:55Now, if we think about technical debt as financial debt, it compounds in mysterious and sometimes unexpected ways.
- 02:01But you should think about it in a rigorous format as well.
- 02:04For us to achieve some kind of ROI by taking on technical debt, such as building a feature or getting new customers, we want to make sure that the ROI makes sense.
- 02:12If we introduce additional complexity into our code base, we can very quickly outrun the ROI we've generated.
- 02:21Now with AI engineering, you've probably seen a number of different stories that have come out to showcase the progress that's been made.
- 02:26These are two case studies from Anthropic, one from Spotify and the other from Stripe, talking about the immense progress that they've made both in shipping velocity and also the ability to refactor code.
- 02:37So at this point in time, writing code or making changes is something that teams are doing faster and faster.
- 02:43Now I'll pause here.
- 02:46Who here thinks that products have gotten better in the past 20 years?
- 02:49Technical products.
- 02:50Also raise your hand.
- 02:52I hope everybody, right?
- 02:54Phones are pretty cool.
- 02:55How about 5 years?
- 02:58How about the past year?
- 03:00Okay.
- 03:01So the challenge is that we're going faster and faster through the technology life cycle, but we've lost something.
- 03:06The the product focused on customers in some way has degraded, the maintainability of the code and the reliability has degraded.
- 03:13You can see some of the uptimes here from two leading companies.
- 03:16I blurred out their names for for it it doesn't actually matter who they are, but we are below a three-nine or even four-nine reliability.
- 03:24So even though we're shipping faster and faster, the code quality and the product quality has not necessarily gone up.
- 03:31So let's talk about the refactor that we did.
- 03:32So we started this refactor with actual code implementation in April and did some pre-work earlier.
- 03:38So I'll go through five different tasks that we did and share some of the the findings that we had before and after, especially with as new models have come out.
- 03:46So we spent around 2 months evaluating orchestrators for our AI pipeline.
- 03:50We looked at five open-source projects and we wanted to benchmark and see how effective they were for our use case.
- 03:56And we started this off before deep research came out as part of Google and OpenAI, so that web search capability to do a comprehensive analysis was still not there.
- 04:04Now, after we actually gathered these requirements, we built out proof of concepts with a team of three to make sure that we actually got the right results.
- 04:12Now, I'm pretty confident we could do this 90% faster now with the tooling that we have.
- 04:17Before we would manually go through, use a little bit of AI, but put everything into a Confluence doc, and we'd evaluate across 17 different criteria that we came up with.
- 04:26Nowadays, we could build a much more agentic workflow to do that, starting off with deep research, uh making sure that we match that against the problem statements that we have,
- 04:35creating sub-agents for each of these criteria and uh products, and then finally building POCs and evaluating.
- 04:41So, things have changed in the past year and a half where we could actually go much, much faster.
- 04:46But, we still have to maintain that same set of quality because it's very easy to undergo AI psychosis, where you look at a deep research report that's 20 pages long and you say, "Wow, this looks good."
- 04:56And then those features don't actually exist in the product, and you've set yourself back.
- 05:01Now, after we've done the initial uh orchestration research and model serving research, we wanted to actually commit in code.
- 05:07This is just a example of what happened when we were experimenting.
- 05:11I was doing some initial research with Temporal and committed some activities and workflow code to make sure that we can actually replicate what we have in the legacy code base.
- 05:20So then, I did what we wanted to do over a number of iterations and at the time gave it to O3 to actually try to implement this code.
- 05:28And it did it much faster than I would be.
- 05:30This refactor took uh 3 hours of back and forth chatting with Incursr, but it made 10 major mistakes.
- 05:36So, at the time when we were going through this refactor, agentic coding was getting better and better, but it still hadn't reached the point of where it is now.
- 05:44And it was still a very manual process where you had to intervene and actually guide the model and manually edit or delete code.
- 05:52Now, I reran these benchmarks on some some modern models.
- 05:55So, we have Sonnet 4.6 and Opus 4.8. And things were much faster.
- 05:59Sonnet 4.6 with one additional iteration was able to solve the task.
- 06:04And with Opus, it was basically able to one-shot this problem.
- 06:07So, models are getting significantly better along with harnesses.
- 06:10And the interesting part here as well is that the way that the models interacted has changed substantially as well.
- 06:15Before with O3, there weren't substantial tool calls on certain categories.
- 06:20And then as we moved into Sonnet 4.6 and Opus, we see now that in modern harnesses, we get sub-agents, we get some of those plan calls, we get different shell commands, and we get different verifications.
- 06:31And overall, this process, even though the model execution was a little bit more expensive, it was a lot less manual.
- 06:36So, we could actually accomplish a lot more.
- 06:39So, if I was rebuilding the same task that I had for for this refactor, it would take around 1/5 of the time to accomplish, which is pretty good progress.
- 06:48So, I think all of us realize the scenario that models are substantially better now than they were before.
- 06:55Now, this is really important because it shapes the way we think about the software development life cycle.
- 07:00We think about 2025 and the types of work that we were doing.
- 07:03We were making some small changes.
- 07:04We would give specific code snippets to models.
- 07:07We were just starting to get into this agentic framework of the type of work we can do.
- 07:12And now if we provide a well-constructed spectrum model, it could generally execute it at a very very high capability level.
- 07:19And we can see this both in anecdotal experiences as well as some of the thought leadership that has been coming out of the big labs.
- 07:25The this image is one from Anthropic.
- 07:29Let me ask the group a question.
- 07:31Who here has kicked off an agent and realized that either the prompt, the plan, or the requirements were incomplete or missing?
- 07:38A lot of people, yeah?
- 07:39It's it's very frustrating, right?
- 07:40You you're like, "Okay, I'm ready to go.
- 07:42It's 11:00 p.m. or 5:00 p.m. I'm going to set off an agent and then come back."
- 07:47And then you realize there is a there is a critical flaw.
- 07:50Now, the reason I bring this up is it's very important to have a good mental model and understanding how accurate models can be in accomplishing tasks.
- 07:57Who here has seen this meter graph before?
- 08:00I think a decent number of people.
- 08:01So, this is pretty common on actually mapping how much time models can complete tasks of certain categories for.
- 08:07So, the idea being that as models get better and better, they can do longer-running tasks.
- 08:11Now, typically this graph is shared with the 50% accuracy rate, but I think it's much better to actually look at the 80% accuracy rate or higher.
- 08:19And you can see there you can still see a similar exponential trend, but we're no longer claiming that models can accomplish tasks that would take a human 18+ hours.
- 08:27Now, I actually think it's much better to measure the accuracy at 90% or 99% because this is where the mental model is most efficient.
- 08:34You construct a plan, you create a spec,
- 08:36[snorts]
- 08:37you hand it off to an agent, and you're pretty sure that it'll get things done, right?
- 08:40You don't want to be creating a plan or a spec and then have a 50/50 chance of coming back and knowing that you wasted compute and your attention span.
- 08:48Now, if you're kicking off a process that is going to take an hour and it has a 50% chance of completing, there's a very high chance you just wasted that hour and you could have been doing something different.
- 08:58Now, if you think about uh broader evaluation, so Meter does have some more information about their frontier models.
- 09:05So, this is one for for Metis' preview that they did roughly a month ago, and you can see here that generally the success uh rate starts to decline significantly at that 4-hour mark, but even before then at the 15-second mark or even before the 15-minute mark, there are certain tasks that Metis, uh in in all its glory,
- 09:21cannot complete uh effectively and consistently.
- 09:25So, we're making rapid progress in in the AI model space, but we're still not there where you can just kick off an agent and have something be completed reliably.
- 09:33So, again, this is really important for your software engineering teams and for you as an IC to understand what is your mental model and how are you going to contribute to that.
- 09:43I think what's really important is I think you've been hearing this throughout this conference is that there are a number of different frameworks and primitives that you need to have implemented in order to have good agentic development.
- 09:52And this is no different from from what we found.
- 09:54As we were continuing to mature as an organization and going through our refactor, these are the things that made sure that we can implement the solutions effectively and not waste our time just running in loops with models.
- 10:08So let's go to chapter three.
- 10:09Let's talk about the refactor itself and some of the productivity gains that we saw.
- 10:13So the core idea is that we had these 10 repositories, we put them into a mono repo, and we wanted to build additional features on top of it.
- 10:21So this is this is the result.
- 10:23The previous repos had been around for more than six years, and you can see the progress that was being made it is pretty slow.
- 10:29Part of it was because of the tech debt that was taken on.
- 10:32Other parts were because we didn't have AI coding tools.
- 10:35And you can see that within the first six months of the rebuild when we got to parity that we had before, that steepness of that curve is immense.
- 10:43And it didn't slow down after we we kept shipping.
- 10:46So after that that dotted line in the middle there, we kept adding new and new features into the repository.
- 10:53And we shipped a lot faster both in terms of the amount of code even though that's not a great metric, but also the commit rate that we had among developers.
- 11:01And we actually saw that a lot more developers actually joined in into the contributions.
- 11:05So this is a log graph on the commits that we had from the repository initially, and then we slowly on-boarded more and more people.
- 11:12And we had fewer commits because it's much easier to commit code when you're just refactoring and replicating something, but we still kept up that velocity as we were adding product features towards the end.
- 11:22And now almost every developer within the company is committing to this new mono repo even though it might not be their area of expertise, but they might need to make changes to schemas,
- 11:30API calls, and other parts of of the stack.
- 11:35So, let's go into chapter four.
- 11:37Can a modern LLM zero-shot this problem?
- 11:39Can I say, "Hey, amazing LLM, go refactor this code base."
- 11:44So, I ran this experiment with GPT 5.5 extra high, and I gave it this goal, giving some of the names of the repositories with the underlying models and other components,
- 11:54and it completed its goal in in 10 minutes and 22 seconds.
- 11:59And it only wrote 2,000 lines of code, which was a little bit fishy.
- 12:02So, I I dug deeper.
- 12:04Um and it actually just implemented a bunch of scaffolding and didn't implement the models.
- 12:09So, you can see here, I did not add a ray serve deployment or bootstrap command yet, right?
- 12:13So, we're still not there where models can self-validate and just one-shot these kinds of problems, but we're getting close.
- 12:20I think in in 6 months, we'll get to the point that we can complete pretty substantial refactors, as we saw in the in the Stripe example, consistently across the board.
- 12:30So, get to the core question.
- 12:31Was this refactor worthwhile?
- 12:32Should we have waited a year to do this refactor as models and harnesses continue to get better, or did it make sense to do it at the time?
- 12:39Now, I'll say the the other side of the argument, right?
- 12:43Things are getting substantially better.
- 12:45Models are getting better.
- 12:46They can call tools better.
- 12:47We have a lot more infrastructure like sandboxes and monitoring frameworks in order for us to actually understand what's happening under the hood with these models.
- 12:55So, taking on technical debt and refactoring later is getting exponentially easier as the days go by.
- 13:03Now, the problem is that a lot of times when when you build a lot of code and you do this kind of development in an AI AI-native world, it starts looking like some of the legacy code we've we've seen in the past.
- 13:13There's a lot of code written.
- 13:14It's written with low performance or quality, and the broader problem is people don't actually understand what's happening there.
- 13:20So, if you have some issues within the code base or you want to adjust based on customer requirements, it's actually much harder to do so.
- 13:26So, you do have to make sure that there are appropriate guardrails, whether or not you do a full refactor or only a partial one.
- 13:34So, if you ask me, was it worthwhile?
- 13:35I'd say yes.
- 13:37Uh we had built out the patterns that we had earlier with the number of different repos in in order to match customer requirements and demands.
- 13:44Uh it took an amount of time, but we ultimately achieved the goals of the business.
- 13:48Then we came back and refactored and we were able to accelerate.
- 13:52Uh we were able to actually reduce the amount of time the pipeline took.
- 13:56We were able to reduce the costs.
- 13:57We could support larger files, and now we can ship features that would take multiple months in under a week.
- 14:03So, the monorepo refactor, the cleanup was worthwhile, and we have some of the productivity metrics we saw there.
- 14:09The other part is that beyond just shipping velocity, developers actually want to work in this codebase.
- 14:13So, everybody comes along and says, "Hey, can I work in this codebase?
- 14:17It's much cleaner compared to the other ones.
- 14:19Uh can we actually contribute in a way that makes sense?"
- 14:22And a lot of the patterns we have adopted here have spread to other repos within the company.
- 14:28Now, whether or not you refactor, uh the AI delivery system is is a layered approach.
- 14:33Uh you can isolate different parts of your codebase to avoid a full refactor, but there's so many components that you need to keep in mind.
- 14:40And hopefully throughout this conference, you've heard more details about this.
- 14:43But I I really encourage everybody to think about uh the the business value of delivering a a big refactor and the tradeoffs of doing it now versus in the future.
- 14:51So, models will continue to get better, uh but sometimes it's good to pause, build a monorepo, and forge ahead.
- 14:58So, thank you everybody.
- 14:59Uh happy to take any questions.
- 15:01[applause]
- 15:15Yeah, so the question was before we had multiple repos and did we move into monorepo?
- 15:20Yes, uh we did that.
- 15:21One of the things we found now was that models are much better at navigating multiple repos.
- 15:25So, if you put it into a higher-level folder, right, they could navigate the the file directory.
- 15:30But, for doing that end-to-end testing and verification and deployment, it's still much harder to do with multiple repos.
- 15:36Uh and if you're building a sandbox environment to run sort of a full AI factory, it's it also takes more time to clone repos and get everything set up.
- 15:44So.
- 15:46Yep.
- 15:59Yeah, so the question was uh when we define certain features and requirements that we go back and check them and make changes uh as well as sort of the guardrails framework.
- 16:07Uh we did.
- 16:07I think we got uh 15 out of 17 requirements right when we were going ahead with the refactor.
- 16:13Um and some of the processes that we added for the actual AI engineering verification, that evolved over time.
- 16:20So, for example, when we started, plan mode was just barely coming into Cloud Code and didn't exist in Cursor, but we adopted it as part of our development life cycle.
- 16:30Yep.
- 16:36So, our PR reviews were all all human PR reviews during that refactor.
- 16:40Uh we did some local checks where we ran skills to say, "Hey, review this code.
- 16:44Make sure that it's good."
- 16:45And they're continuing to get more autonomous as time goes on.
- 16:49But, at that point, PRs were really good way for us to build context uh for that repo as we only had a few developers working on it, and we wanted to make sure people understood
- 16:57what had gone into the refactor.
- 17:00Yep.
- 17:07Um in terms of factors, I think that the complexity of the task you can give to a model uh is going to be different, and many more companies will have more scaffolding
- 17:17in terms of actually doing a refactor.
- 17:19So, for example, when I showed the the life cycle of doing the research, the POC work, um validating the code quality, checking hidden assumptions, like you you thought an open-source library had this feature, but it was actually in
- 17:32uh a beta, for example.
- 17:34I think that is going to be much much faster on top of sort of the standard refactoring of hey, here's a file, rewrite it to to match this uh set of requirements.
- 17:47All right.
- 17:47Great.
- 17:48Thank everybody.
- 17:48Have a great rest of the conference.
- 18:04[music]