Topic 3 of 5 · 5 min read
Reviewing a cloud agent's pull request
Goal: Review an agent-opened pull request in risk order and decide to merge, request changes or close it.
Review a cloud agent's pull request in risk order: did it do the task, did it prove it, and did it touch anything it should not have. The agent worked alone, so the pull request is the first time a person sees the result.
Check yourself · 1 of 3
What should you check before reading the code of an agent's pull request?
Why it matters
An agent's pull request description is its own report on its own work. It can say "all tests pass" after deleting a test, or "fixed" for a problem it only hid. You are the first independent check, and the review often costs more than the agent run did.
A review order that works
- Match the task. Re-read the issue. Does the title and diff do that, and only that? A pull request that answers a different question is a close, not a fix.
- Look at the file list first. Any file outside the named area, a lockfile change, a config, a CI workflow or a migration deserves a question before you read a line of code.
- Read the CI result. Green is necessary. Then ask what CI does not cover.
- Read the changed tests. Were tests added for the new behaviour, including the failure case? Were any edited to pass, skipped or removed? A weakened assertion is a red flag.
- Read the session log. Cloud agents keep a log of commands and steps. Check which commands it ran, whether setup failed, and whether it ran the tests or only claimed to.
- Read the code at the edges, as for any diff: empty input, errors, concurrency, callers of changed functions.
- Decide. Merge, request changes with a concrete comment, or close and rewrite the issue. Do not patch a wrong approach line by line.
Before and after
A weak review comment: "Looks good, tests pass."
A better one: "The diff matches the issue. parseInvoice.test.ts lost the case for a missing dueDate (line 41 removed). The code now returns undefined there. Please restore the test and handle the missing date explicitly."
What goes wrong
- Trusting the description. It summarises intent, not the diff.
- Reviewing the code before the scope. You spend an hour polishing a change that should never merge.
- Approving on green CI. The agent may have changed the test that was red.
- Fixing it yourself silently. You learn nothing about why the issue led to a wrong result. Update the issue or the instructions file too.
Examples
The weakened test
- expect(total(order)).toBe(118.5)
+ expect(total(order)).toBeGreaterThan(0)
CI is green because the new assertion accepts almost any value. The agent changed the check instead of the code. Request the original assertion back and a real fix.
Out of scope file
The issue asked for a bug fix in src/cart. The file list includes .github/workflows/deploy.yml. Even if the change looks harmless, ask why before reading anything else. A workflow change can alter what runs with secrets.
Key points
- Start from the issue: the pull request should do that task and only that task.
- Scan the file list for anything outside scope, such as workflows, configs, lockfiles and migrations.
- Green CI is necessary, not sufficient; check which tests were added, edited or deleted.
- Read the session log to see what the agent actually ran.
- Decide to merge, request changes or close; if the approach is wrong, fix the issue, not the diff.
Common mistakes
- Reading the pull request description as proof that the work was done.
- Skipping the file list and going straight to the code.
- Treating a green build as approval without looking at changed tests.
- Editing a wrong pull request by hand instead of closing it and improving the issue.
Check yourself · 2 of 3
CI is green on an agent's pull request. What is the most useful next check?
Check yourself · 3 of 3
An agent's pull request solves a different problem than the issue described, though the code is clean. What do you do?
Practice items, not counted towards your mastery.
Start here
- About GitHub Copilot cloud agent (opens in a new tab)DocsFree
How an agent is assigned an issue, works in a sandbox, opens a draft pull request and waits for human review.
- Codex cloud (OpenAI) (opens in a new tab)DocsFree
How Codex runs tasks in a cloud environment with a setup script, and what network access it has.
- Claude Code on the web (opens in a new tab)DocsFree
How Claude Code runs sessions in a remote environment, how setup scripts and network rules work, and how changes come back as a branch.