Investigation of inconsistent review results on docker/pinata PR #39588#62
Merged
derekmisler merged 1 commit intodocker:mainfrom Mar 3, 2026
Conversation
d35e233 to
75f86cf
Compare
Contributor
There was a problem hiding this comment.
Review Summary
Critical Issue
The new git diff fallback at line 170 lacks error handling — if the command fails, pr.diff may be created but empty/corrupt, causing the agent to approve an empty diff (the exact false approval bug this PR aims to fix).
Recommendation
Add error checking after the git diff command:
if ! git diff "$MERGE_BASE"...HEAD > pr.diff; then
echo "Error: git diff failed" >&2
exit 1
fiThis ensures the pipeline fails fast with diagnostics instead of silently proceeding with a bad diff.
✅ The other changes (ANTI-LOOP RULE, model upgrade, chunking, metadata simplification, cache fix) look good and address the determinism issues described in the PR.
Signed-off-by: Derek Misler <derek.misler@docker.com>
75f86cf to
3bca9c5
Compare
trungutt
approved these changes
Mar 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ANTI-LOOP RULEnow posts a COMMENT with unverified findings instead of silently approvinggit diffmerge-base fallback whengh pr difffails, with stderr capture for diagnosticsdiff --gitboundaries into ~1000-line chunkspr.diff/gh_pr_diff/git_diff) for observabilitypr_metadata.jsonfrom diskgithub.jobto cache keysContext
Investigation of inconsistent review results on docker/pinata PR #39588 revealed:
gh pr difffailed (bare number in detached HEAD), the LLM improvised differently each runANTI-LOOP RULEauto-approved when the verifier returned garbageHaiku(drafter model) had inconsistent bug detection recallThese changes make the pipeline more deterministic — bash-level fallbacks handle diff failures before the LLM is involved, verifier failures surface findings instead of hiding them, and
Sonnetimproves draft quality at the cost-sensitive step.Test plan
cagent run review-pr/agents/pr-review.yaml "Review my changes"from a repo with a local branch/reviewon a known-buggy PRgh pr difffailure