You need to treat the code that arrived in response to your prompt as a raw material: just like some truckload of unrefined and unmolded "stuff", it just arrived at your factory door, and it is still in need of banging into shape.
Your job is to build and operate the machinery (which is also software) that turns raw slop into worthy output.
Determine the tolerances (eg. quality tolerance: how bug-free must this be to ship?) and then work out how you'll scale up and remove yourself from as much of the attainment of those tolerances as possible, given constraints.
Consider by way of analogy an industrial food factory that mass produces, say, pickled fish. The fish are caught and brought to the factory - that's your agent's first-draft output. Next the fish are put by hand on a belt to be dipped, fired, cured, etc. - that mix of by-hand steps and automated steps is where you'd be crafting the custom linting steps, making the code compiled and having the agent write tests that prove quality, playing with the work (testing the feature, bugfix etc. by hand) and bringing it further from slop to the level of quality that's needed. The amount of this you do is determined by constraints - cost, time, etc.
Now that you're sizing your efforts against constraints and using tolerances as a tool, you're making the transition in your role, from craftsperson to engineer.
It's sort of like a factory. But it's never going to be a lights-out factory. You should design, supervise and improve the process in line with constraints and tolerances provided by stakeholders. And leave perfectionism at the door. You can chase your own definition of perfection in your hobby time, or if you want to get paid for perfection, start your own business where you call the shots.