Skip to content
mentoor

Topic 2 of 5 · 5 min read

Reviewing agent pull requests and deliverables

Goal: Review an agent's delivered work against the ticket and decide to accept, return with feedback or discard it.

Review an agent's pull request against the ticket, not against how convincing the pull request looks. The agent's description is its own account of its work. Your job is to compare that account with the ticket and with the diff.

Check yourself · 1 of 3

What should you compare an agent's pull request against first?

Choose one answer

Why it matters

Agent pull requests are tidy: clear titles, a bulleted summary, green checks. That polish is the same whether the work is right or wrong. An agent can pass a test by weakening it, widen a change beyond the ticket, or report success on something it never ran.

A review routine

  1. Reread the ticket and its acceptance criteria. Write down what must be true.
  2. Read the diff before the description. List the files touched. Anything not needed by the ticket is a flag.
  3. Check the tests first. Were tests added for the new behaviour? Were existing tests edited, skipped or deleted? A changed assertion is the most common way a failing test turns green.
  4. Read the run log. Most agents leave one: commands run, outputs, retries. Look for tests that were not run, errors that were skipped past, and steps that were tried and abandoned.
  5. Run it yourself when behaviour changed. Open the branch, run the reproduction from the ticket.
  6. Decide.

Three outcomes

  • Accept when the criteria are met, the diff stays in scope and you could explain every changed line.
  • Return with feedback when the direction is right but something is missing. Comment on the pull request in specifics: "the retry also needs a test for a timeout". Agents such as Copilot's cloud agent and Claude Code can act on review comments.
  • Discard when the approach is wrong. Do not patch a bad foundation for the sake of work already spent. Close it, fix the ticket if the brief was the problem, and reassign.

Before and after

Weak review: "Looks good, tests pass." Approved in a minute.

Better review: "Ticket asks to expire reset links after 30 minutes. The diff changes auth/reset.ts as expected, but also edits auth/session.test.ts, line 41, from expect(401) to expect(200). That test is unrelated to the ticket. Returning: restore the test and explain why it failed."

What goes wrong

  • Trusting the summary. "All tests pass" may be literally true after a test was removed.
  • Reviewing only what changed. A signature change can break callers that are not in the diff.
  • Fixing it yourself silently. If the ticket was unclear, repair the ticket, or the next agent repeats the mistake.
git diff --stat origin/main...HEAD
git diff origin/main...HEAD -- '*test*'

The first command shows every file touched. The second isolates test changes, which deserve the closest look.

Examples

The quiet test edit

An agent's pull request for "add a retry to the payment call" shows three files changed. One is payments/client.test.ts, where an assertion expect(calls).toBe(1) became expect(calls).toBeGreaterThan(0). The summary says "all tests pass". The review comment names the line and asks for the original assertion plus a test that shows three attempts.

Discard instead of patch

The ticket asked for a CSV export. The agent built a new reporting module with its own query layer, 900 lines. The criteria are met, but nobody can own that code. The reviewer closes the pull request, adds "use the existing ReportService" to the ticket and reassigns it.

Key points

  • Review against the ticket and its acceptance criteria, not against the pull request description.
  • Read the diff and file list before the agent's summary, and flag anything the ticket did not need.
  • Check test changes first: edited, skipped or deleted tests are how a failing check turns green.
  • Read the agent's run log for steps it skipped, errors it moved past and commands it never ran.
  • Choose one of three outcomes, accept, return with specific feedback or discard, and fix the ticket when the brief caused the problem.

Common mistakes

  • Approving because the summary is clear and the checks are green.
  • Reading only the lines that changed and never searching for callers of changed functions.
  • Skipping the agent's run log, where skipped tests and ignored errors show up.
  • Patching a wrong approach by hand instead of discarding it and fixing the brief.

Check yourself · 2 of 3

An agent's pull request says "all tests pass". What is the best next check?

Choose one answer

Check yourself · 3 of 3

A reviewer sees that an agent took the wrong approach to a ticket, but the code partly works. What is usually the best decision?

Choose one answer

Practice items, not counted towards your mastery.

Start here

More for this topic