ZIV LABS
Build log

Where we stop reviewing an AI agent's pull request, and three times our auto-revert was wrong

An AI agent's pull request can be reviewed without end, and an automatic safety net can be wrong without anyone noticing, so on November 15 and 16, 2026 we wrote down where reviews stop and where our own automation misjudged. This log is about two things only: the rule that stops review rounds by the weight of a finding, and the mistakes made by automatic decisions, including one made by us. The overall design of the checks is in the earlier log on checking pull requests an AI coding agent wrote. The references at the end name the records every statement comes from. Where we have not measured an effect yet, we say so.

Background

Our pull requests are written by an AI coding agent from an issue, reviewed by a second model (Codex), reviewed once more by Claude, and merged by the owner or, for a narrow class of changes, by an automatic rule. Two questions came up in the same two days. How many times should a reviewer be allowed to send a pull request back? And what happens when an automatic decision, such as reverting a merge that seems to have broken a build, is itself wrong?

What we decided: stop by weight

  • Codex asks for changes only for a blocking or major finding that someone outside can cause. Minor findings, and findings that can only happen on the owner's own computer, come with an approval and are collected for a retrospective.
  • A request for fixes is made at most 3 times for a pull request in the factory repository itself (the limit is called MAX_ROUNDS).

What happened

1. The pull requests about the merge gate hit the limit

On November 15 the factory repository had 9 pull requests. Together they received 10 requests for fixes in 9 pull requests, which is 1.1 per pull request. Three of them reached the limit of 3 rounds: #386, #387 and #391. All three touched the rule that decides automatic merging, the gate.

  • #386 was reviewed by Codex 5 times and it asked for changes all 5 times, each time for a major problem in a different place. We closed it and split the work into two issues, #389 and #390.
  • #391, the pull request for #389, was reviewed 5 times and 4 of those asked for changes. After 3 rounds of fixes the supervisor took it over by hand, fixed the 2 remaining major findings, and the next review approved it. We do not read this as "by hand it passes in one round": the starting point was different, because the 3 earlier rounds were already in it.

We added three lines to the request for fixes: look for the same kind of hole elsewhere, do not weaken an existing test, and run the whole test suite or say that you could not. These went in before we measured anything. We plan to compare the numbers around November 29, 2026, and until then this is a change, not a result.

2. The first final review by a larger model found a hole that two approvals missed

On pull request #399, Codex approved the change twice, at commits 63e4264 and 133aad07, and the Sonnet final review approved 63e4264. Right after #403 changed the final review to Opus 5.5 at medium effort, Opus did the first final review and found a major problem: a judgement made after a merge would have judged again every past pull request that carried only an old marker, which would have put wrong comments on dozens of pull requests. It was fixed and approved. This is one case, so it shows that the final review can find what earlier approvals did not, not how often.

3. The automatic revert was wrong 3 times

When a merge to the main branch is followed by a failing check, a rule (#351) opens a pull request that reverts it. In three cases it was wrong, and each time the owner closed the revert pull request.

  • ziv-distribution #168. The failing run was Dependabot's scheduled update, which runs regardless of any push (it had also failed on November 6, 9 and 16). It had nothing to do with pull request #166. Fix (#422): look only at the checks that ran because of the push.
  • small-tools #94, #95 and #96. Four Dependabot pull requests were merged one minute apart. The CI setting concurrency with cancel-in-progress cancelled the runs of the first three, so they showed as cancelled. The CI of the last commit had passed. Fix (#432): a cancelled run is not a failure, and the decision follows the result of the later commit. A second fix (#436) also reports a failure that is only known after the waiting period has ended.

4. The supervisor was wrong too, and the reviewed side stopped it

Twice (ziv-labs.com #158 and #160) our supervisor wrote the machine check of an issue so that it fixed the place of the implementation. The Claude run implementing the issue did not put meaningless text in a file just to pass the check. It pointed out the mistake in the issue in a comment on pull request #159 and returned it. Machine checks are code too, and they can be wrong.

What we learned

  • A limit on review rounds by count alone sends a pull request about a hard rule back and forth; a limit by weight keeps minor points from using up rounds, and the count limit still ends the loop.
  • An automatic action that undoes someone's work needs to know what caused the failure. A failure that did not come from the push, or a run that was cancelled, is not evidence against the merge.
  • A check that cannot be satisfied except by writing something meaningless is a sign that the check, not the implementation, is wrong.

Rules we keep now

  • Request changes only for blocking or major findings an outside person can cause; at most 3 rounds in the factory repository.
  • A request for fixes asks for the same kind of hole to be searched for elsewhere, for existing tests to stay as strong as they were, and for the whole test suite to be run (or for the reason it could not be).
  • The automatic revert looks only at checks started by the push, does not count cancelled runs as failures, and follows the result of the later commit.

What we have not checked

  • Whether the three added lines reduce the rounds: not measured yet.
  • Whether Opus finds more than Sonnet in the final review: we have one case.
  • How often the automatic revert is right: we looked at the cases that were wrong, not at the total.

References

Our own records (private repositories, named here so the claims above can be traced):

  • ziv-labs/agentic-factory-vnext #189 — review rounds by weight; at most 3 requests for fixes (MAX_ROUNDS)
  • ziv-labs/agentic-factory-vnext #386, #387, #391, #389, #390, #401 — the pull requests that reached the limit, the split, and the three added lines of the request for fixes
  • ziv-labs/agentic-factory-vnext #399, #402, #403 — the first final review by Opus and the hole it found
  • ziv-labs/agentic-factory-vnext #351, #422, #432, #436 — the automatic revert and its fixes
  • ziv-labs/ziv-distribution #166, #168 — a revert caused by Dependabot's scheduled run
  • ziv-labs/small-tools #94, #95, #96 — reverts caused by cancelled runs
  • ziv-labs/ziv-labs.com #158, #159, #160 — machine checks that fixed the place of the implementation

Related notes