Sub topic 10
Steering with specific, bounded feedback
This chapter assumes you can read a Git diff, run your project's tests from the command line, and have already reviewed an agent's change set. It covers what to do after the review finds problems: how to tell the agent what to fix without making things worse.
Why vague feedback fails
A message such as "this isn't right, try again" gives the agent nothing to act on. It has to guess what was wrong, and a guess often means rewriting code that was already correct. Vague feedback also invites broad edits, which enlarge the diff you must review a second time.
Good feedback has four parts:
- What is acceptable. Say which changes are correct, so the agent leaves them alone.
- Each problem, named with its file. One numbered item per defect, with the path and the symptom.
- A bound on the next edit. State which files may change and which may not.
- A verifiable report. Ask for the exact command it ran and its result, so you can repeat it.
A worked example
Suppose you asked the agent to rename the config loader. Your review found two defects. It edited src/billing/invoice.py, which is outside the task. It also marked test_missing_file as skipped.
The change to src/config/loader.py is correct. Two problems remain:
1. You edited src/billing/invoice.py, which is outside this task. Revert that file.
2. tests/test_loader.py now skips test_missing_file. Restore the test and fix the code so it passes.
Do not change any other files. When finished, run the project's test suite and report the exact command and its result.Each part of the message has a job:
| Part of the message | Purpose |
|---|---|
| "The change to src/config/loader.py is correct." | Protects good work from being rewritten |
| Numbered items with file paths | Lets the agent address each defect separately |
| "Restore the test and fix the code" | Says which side to change, so the test is not weakened again |
| "Do not change any other files." | Bounds the next edit |
| "Report the exact command and its result" | Gives you something to reproduce |
Item 2 matters most. If you only say "the test is skipped," the agent may delete the test instead. Name the direction of the fix.
The steering loop
The feedback step sits between review and the next run. After each round you review again, and you check only the files you allowed the agent to touch.
Common mistakes in feedback
- Bundling unrelated requests. Asking for a bug fix, a rename, and a style cleanup in one message makes it hard to tell which edit caused a new failure. Fix one class of problem per round.
- Describing the symptom without the evidence. Paste the failing test name or the error line. "The loader breaks" is weaker than the output of a failing run.
- Leaving the bound implicit. If you never say "do not change other files," assume the agent may.
- Correcting by hand and the agent in parallel. If you edit files while the agent is revising, you can no longer tell whose changes are whose. Finish one before starting the other.
- Repeating the same correction. If you give the same feedback in three tasks, the guidance belongs in project instructions, which a later chapter covers.
After each round, run git diff --stat again. If the agent touched files outside your bound, treat that as a new defect and name it in the next message.
Exercise
An agent's change makes test_parse_dates fail, and it responds by adding @pytest.mark.skip to that test. Write the two-sentence core of a corrective message that fixes this without inviting the same mistake.
Show answer
For example: "Remove the skip from testparsedates in tests/test_dates.py and fix the code in src/dates/parser.py so the test passes as written. Do not change any test files, and report the exact test command you ran with its result." This names the file, states which side to change (the code, not the test), bounds the edit, and asks for a result you can reproduce.