capstone — ship the system12 / 12
wire it all together — a cli agent in 12 steps
Checkpoint
One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.
Last one. The starter has a complete agent — fake LLM, tool registry,
the loop, and a log_lines list for the trace. The loop is wired to
exit after the LLM returns end_turn. Right now the script prints
the final answer but doesn't log a single thing — log_lines ends
empty.
Add two log_lines.append(...) calls inside the loop so that:
- After every LLM response, you append a JSON string of
{"turn": turn, "stop_reason": response["stop_reason"]}. - After every successful tool call, you append a JSON string of
{"turn": turn, "tool": block["name"], "result": result}.
Then the script prints the count of log entries.
Expected output:
done. todos: write tests
log entries: 3
⌘↵ runs the editor.
Booting Python…
Output
[promptdojo:~]$ _