promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_

What an agent leaves behind — step 9 of 9

Checkpoint

One last thing before we move on. pass this to mark the lesson done, or skip and keep moving. hop to the next when you're ready.

Last one. The starter has a trace and a partial find_first_bad_turn function. The function should return the n value of the first turn whose stop_reason is NOT tool_use and NOT end_turn. Right now it returns None. Finish the body so it returns the right turn number.

Expected output:

3

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