Explain it back
Before accepting code, say what it does in your own words, including what it does on awkward inputs, then check yourself by running it. If reality disagrees with you, you have just found what you did not understand.
Reading code gives a strong feeling of understanding that often isn't real, and an agent's tidy explanation makes that feeling stronger. Predicting and then running is a test the feeling can fail. It is also the skill an interviewer is checking when they switch the agent off.
Say it to your agent
“Don't explain src/cart.ts to me yet. I am going to tell you what happens on an empty cart and when the payment call times out. Then write those two cases as tests, run them, and show me where I was wrong.”