Chapter 12 · Tools, agents and harnesses
Coding agents
Coding agents read a codebase, edit files, run tests and iterate until the tests pass.
Preparing coding agents
Chapter 12 · Tools, agents and harnesses
Coding agents read a codebase, edit files, run tests and iterate until the tests pass.
const sum = add(nums);return sum / (nums.length - 1);
The agent reads the tests.
The test bar is the agent’s eyes. Red means keep working. All green means the job is done.
A coding agent opens files, searches the project and reads the tests to learn what “working” means.
The average function is wrong. Pick a patch, run the tests, and read what the failures say. Some patches fix only part of the problem.
const sum = add(nums);return sum / (nums.length - 1);
No test run yet.
The four patches are written for this lesson and really run on the four tests. A real agent writes its own edits.
Why does a coding agent run tests?
A patch passes three of four tests. What should the agent do?
What does a green bar prove?