Sub topic 3
Steering and Controlling a Coding Agent
Assume you know basic Git, can read code, and can run the project’s tests and checks. Your responsibility continues after the agent reports success: you must decide which changes are correct and what happens next.
Give specific, bounded feedback
Feedback should identify the accepted work, each defect, the exact file or behavior involved, and the required verification. Bound the next edit by naming what the agent must not change.
The loader change in src/config/loader.py is correct.
Fix these problems:
1. Revert the unrelated edit in src/billing/invoice.py.
2. Restore tests/test_loader.py:test_missing_file; do not skip or weaken it.
3. Add coverage for the missing-file behavior.
Do not modify other files. Run the loader tests and report the exact command and result.This is more useful than “please fix the issues.” It gives the agent a smaller search space and gives you evidence to check.
Accept part and revert the rest
A change can contain useful and unwanted work. You do not need to accept it as one unit. Stage only reviewed hunks, commit them, and restore unrelated edits.
git add -p
git commit -m "Rename config loader (reviewed agent changes)"
git restore -p .Review untracked files separately because git diff does not show them. If the unwanted change is already committed, revert the specific commit or edit rather than resetting shared history.
Persist repeated corrections
If you repeatedly explain the same rule, put it in project instructions. Useful guidance includes boundaries such as “do not modify migrations,” required commands, and rules against skipping tests. Keep instructions short and repository-specific. Persistent guidance reduces repeated mistakes, but it does not replace review.
Re-run, narrow, or take over
Re-run the agent when the defect is local and the task remains well understood. Narrow the task when the first request allowed too much freedom. Take over manually when the agent misunderstands a core design, repeatedly changes unrelated files, or makes changes whose risk exceeds the value of another run.
Use a repeatable review loop
- Capture the baseline and define “done.”
- Inspect status, the file list, interfaces, and implementation.
- Check tests for weakening and run the full project checks.
- Accept, correct, selectively revert, or take over.
- Record recurring rules in project instructions.
Exercise
An agent changes the requested file and two unrelated files, then skips a failing test. What should you do first?
Show answer
Restore the skipped test, inspect the full diff, and give bounded feedback that reverts the unrelated files and requires the relevant checks to pass.