8.3 KiB
theme, title, info, author, transition, mdc, lineNumbers, monaco, aspectRatio, canvasWidth, layout, class
| theme | title | info | author | transition | mdc | lineNumbers | monaco | aspectRatio | canvasWidth | layout | class |
|---|---|---|---|---|---|---|---|---|---|---|---|
| seriph | Lesson 18 — Why Is Code Generation Not Enough to Build a Coding Agent? | English video course for AI Agents in Depth | Bojie Li | slide-left | true | false | false | 16/9 | 980 | cover | cover |
Why Is Code Generation Not Enough to Build a Coding Agent?
Files, execution, harness recovery, and bounded verification
Problems this chapter will solve
Lesson 18
Why Is Code Generation Not Enough to Build a Coding Agent?
Lesson 19
When Should an Agent Think in Code Instead of Words?
Lesson 20
How Can an Agent Create Media It Can Actually Verify?
Lesson 21
How Can Code Let an Agent Create New Capabilities?
Why this problem matters
Workspace
Files provide durable, inspectable state outside the context window.
Action
Search, editing, and execution tools let the Agent change that state.
Evidence
Compilers, tests, and renderers expose mistakes independently.
Three ideas to keep in view
Inspect
Search before reading; locate the smallest relevant surface
Modify
Apply localized, reviewable edits
Recover
Classify evidence, revise one hypothesis, and stop safely
The book's visual model
Chat code generation vs. Coding Agent
Chat code generation
- Produces a snippet
- Cannot observe repository state
- Leaves verification to the user
Coding Agent
- Navigates a workspace
- Executes and revises
- Stops with evidence
Verification drives the next action
for attempt in range(max_attempts):
patch = edit(inspect(task, workspace))
evidence = verify(patch)
if evidence.passed: return commit(patch)
task = revise_hypothesis(evidence)
return stop_safely(evidence)
Test the claim
Run a write-search-edit-verify workflow
Observe: A real file moves through write, search, localized edit, and independent verification
Run editing and shell-session contracts
Observe: Exact-match edits, failure messages, state preservation, and safe boundaries
class: course-terminal
Switching to the terminal
$ uv run pytest -q chapter5/coding-agent/tests/test_integration.py::TestToolChaining::test_write_search_edit_workflow
$ uv run pytest -q chapter5/coding-agent/tests/test_edit_tool.py chapter5/coding-agent/tests/test_shell_session.py
What the evidence supports
Finding 1
Files make Agent state durable, inspectable, and reproducible.
Finding 2
Tool and test failures become observations that guide the next hypothesis.
Finding 3
A reliable loop distinguishes verified success, safe incompletion, and unsafe failure.