The Tests Pass, But I Still Don't Want This Code

An agent writes hundreds of lines of code in a few minutes. The tests pass, TypeScript reports no errors, the build completes successfully.
Then I open the diff. A new service has been created for a simple feature. A repository has been added behind the service. An operation that will be used in only one place has been moved into a generic helper. A job that could have been solved in three files has been spread across seven. The code probably works. But I still don't want to press the merge button.
The core problem I run into when writing code with AI is not the correctness of the code. Most of the time, the code the agent produces really does work. The problem is that working code is more complex than it needs to be, and this complexity isn't solved by cheap code review skills.
Tests can tell you whether a function produces the right result. But they won't tell you why that same function was built with four different abstractions. Lint rules can catch invalid syntax, but they can't stop a simple job from being needlessly turned into a small framework.
A significant part of code quality is not measurable. Readability, simplicity and how easy the next change will be still require human judgment.
Agents producing unnecessary abstractions is not a coincidence. When we ask them for a "well-designed" or "scalable" solution, they often interpret those words as more layers, more interfaces and more flexibility.
Because producing abstractions is easy. The hard part is recognizing that an abstraction isn't needed yet.
An experienced engineer sometimes writes three lines of code and leaves it there. When the same need comes up a second time, they see the common structure. When it comes up a third time, they create the abstraction.
An agent, on the other hand, may try to solve every possibility that could arise in the future from the very first use. The result is a system that looks technically impressive but is mentally expensive. That's why the idea that "there's no need to read the code the agent wrote" doesn't feel quite right to me.
A simple abstraction that surprised me while building a service with the much-hyped Opus:
const getUserId = (req: Request) => {
return req.params.id;
};
const id = getUserId(req);
Whereas all that was needed was:
const id = req.params.id;
Reading every line with the same level of attention can be inefficient. I admit that. An agent can produce code much faster than we can, and past a certain point human reading speed can become a real bottleneck. But the solution shouldn't be shipping code we don't understand to production.
Because when a bug shows up in production, the responsibility won't belong to the agent. Six months from now, the person who has to change this code will most likely be us again, or another human on the team.
For me, the right boundary is this:
I don't have to know every detail of the code by heart. But I should be able to understand how the system works, where the data comes from and where it goes, and why the structures in use exist.
If I can't explain why an abstraction is necessary, it probably isn't necessary. If I have to keep asking the agent questions to understand a change, the code isn't clear enough. If I can't build the workflow of a feature in my head, green tests don't reassure me.
AI agents have dramatically lowered the cost of writing code. But they haven't eliminated the cost of understanding, changing and owning it.