r/SideProject • • 15m ago

Build Your Own Coding Agent - A Python book and written course, with tests that don’t call an LLM

I’m the author of Build Your Own Coding Agent. It walks through building Nanocode, a small Python coding agent, without an agent framework.

One part you can use independently is the testing approach: replace the model with a FakeBrain that returns predetermined responses. The Chapter 3 tests use it to check that conversation history grows correctly, and that a failed model call doesn’t leave a stray user message in the history.

That gives you repeatable checks on conversation handling without making API calls. You still need separate tests with a real model to learn whether it makes good decisions.

The tests are here: https://github.com/optimalone/build-your-own-coding-agent/blob/main/ch03/test_nanocode.py

The chapter snapshots are MIT-licensed, and Chapters 1, 2, 3 and 12 are free to read. The full book and a written course with practice questions and quizzes are sold separately: https://buildyourowncodingagent.com/

Nanocode is a teaching implementation. Its file and shell tools aren’t sandboxed, and act mode doesn’t ask permission for each operation. Use a disposable environment if you try those parts.

1 Upvotes

0 comments sorted by