An agent-generated pull request has a green build and a full set of tests. A reviewer compares it with the ticket and discovers that the agent guessed how duplicate requests should behave. Every generated test uses the same guess.
The team can still fix the change during review. An earlier opportunity was to catch the missing rule when the agent proposed its implementation plan.
Start with an invoice request that can be retried
Consider a hypothetical invoice API. The ticket says the endpoint should handle duplicate submissions. That leaves several decisions open. Should a retry return the existing invoice? What happens if the caller reuses the same idempotency key with a different amount? What happens when two requests arrive together?
The approved plan could spell out three outcomes. A request with the same key and payload returns the existing invoice ID. A request with the same key and a different payload gets a conflict response.…