promptdojo_

AI wrote an agent loop that BREAKS on tool_use. That's backwards — tool_use is the signal to KEEP GOING (run the tool, append the result, loop again). end_turn is the signal to stop. The fake model returns one tool_use then one end_turn. The broken loop bails on the first response and never sees "done".

Fix line 12 so the loop breaks on end_turn, runs the loop body for the tool_use turn, and prints the final text.

Expected output:

done
The break is on line 14 — 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.