promptdojo_

AI wrote a retry helper that re-tries on any non-2xx status. That's wrong — 4xx errors mean the request itself is broken, and retrying with the same payload just hammers the API. Only 5xx errors are retry-worthy.

Fix the condition on line 4 so the function only retries when the status is in the 5xx family. For 4xx, it should return immediately with the string "client error".

The helper makes up to 3 attempts. With three 4xx responses queued, expected output is:

client error

(one attempt, no retries)

The break is on lines 4, 5 — but read the whole snippet first.

this step needs the editor

on desktop today; in the app (coming soon). save your spot and we'll bring you back here when you're ready.

open this same url on a laptop to keep going today.