Better retries when a sub-agent fails#75
Merged
derekmisler merged 1 commit intodocker:mainfrom Mar 6, 2026
Merged
Conversation
Signed-off-by: Derek Misler <derek.misler@docker.com>
383fb0b to
ed19d25
Compare
Contributor
Author
|
/describe |
Contributor
|
✅ PR description has been generated and updated! |
Contributor
There was a problem hiding this comment.
Review Summary
Assessment: 🟢 APPROVE
This PR adds intelligent error recovery to handle cases where a sub-agent fails but the root agent successfully posts a review anyway. The changes are well-reasoned:
Key improvements:
- ✅ Disables retries (
max-retries: "0") at the pipeline level since the review agent has internal recovery logic - ✅ Adds detection for reviews posted despite non-zero exit codes by checking for
pullrequestreview-[0-9]+in verbose logs - ✅ Treats this scenario as a "partial success" with a warning rather than a full failure
- ✅ Only posts error comments when no review was actually posted
Review notes:
- The grep pattern
pullrequestreview-[0-9]+is specific enough to avoid false positives in practice — it matches GitHub's review ID format which only appears when the API successfully returns a review object - The error handling logic correctly distinguishes between "failed with recovery" and "failed without recovery" scenarios
No bugs found in the changed code. This improves the robustness of the review workflow.
krissetto
approved these changes
Mar 6, 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
When a sub-agent fails (e.g., due to API overload), the root agent can recover and still post a review — but the pipeline previously treated any non-zero exit code as a hard failure, posting a redundant "Review Failed" comment and potentially retrying the entire pipeline, causing duplicate reviews. This PR disables pipeline-level retries and adds smarter exit-code handling to distinguish a true failure from a partial success.
Changes
review-pr/action.yml— disable pipeline retries: Setsmax-retries: "0"on the review step with an explanatory comment, since the root agent already recovers internally when sub-agents fail and retrying the pipeline produces duplicate reviews.review-pr/action.yml— smarter failure detection: Exposesverbose-log-filefrom the review step output and, on a non-zero exit code, checks whether a pull request review was actually posted (by grepping forpullrequestreview-[0-9]+in the log). If a review was found, the pipeline reports⚠️ Review completed with warningsinstead of❌ Review failedand skips posting the fallback failure comment.How to Test
❌ PR Review Failedcomment to the PR as before.