Question
An agent refactored this Python retry helper 'for clarity.' The tests pass and the diff looks tidier. You didn't write the original and the change is subtle. What behavior changed, and how would you have caught it without staring at the diff?
def call_with_retry(fn, attempts=3, base=0.5): last_exc = None for i in range(attempts): try: return fn() except (TimeoutError, ConnectionError) as e: last_exc = e time.sleep(base * 2 ** i) raise last_excThe original had caught only `TimeoutError`; the refactor 'tidied' the except to also include `ConnectionError`.
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 coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.