promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_

Evaluator-optimizer — write a draft, let a judge critique it, revise — step 7 of 9

This loop has no max_iters ceiling. The judge in this test case is stubborn — it never says PASS. As written, the while True runs until the iter pool is empty and Python raises StopIteration (which in production would mean burning through your API budget).

Fix the loop to bail out after at most 3 iterations, returning the string "capped" if no PASS was reached.

Expected output:

capped
The break is on line 13 — but read the whole snippet first.

full-screen editor opens — close anytime to keep reading.