Idempotency key reused under concurrency
You're using a coding agent to add idempotency to a payment-creation endpoint in a Java service. Twice it has produced code that 'works' in the happy path but reuses the idempotency key incorrectly under concurrent duplicate requests — the second request still creates a charge. Each fix tweaks the surface but misses the race. How do you diagnose why it keeps getting this wrong, and how do you re-steer or take over?
resolve_idempotent_charges(request_keys: list[str]) → list[int][["a","b","a"]]out[1,2,1][["k","k","k","k"]]out[1,1,1,1][[" x ","x"]]out[1,1]Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.
Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.