Log GitHub API error details when posting PR review fails#17
Merged
Conversation
When the GitHub API returns a 422 (e.g. 'Line could not be resolved'), log error.response.data.errors and the full response data so we can see which specific comments were invalid. Co-Authored-By: Oz <oz-agent@warp.dev>
captainsafia
approved these changes
Mar 26, 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 the GitHub API returns a 422 error (e.g. "Line could not be resolved") while posting a PR review, the current error handling only logs the generic error message. This makes it difficult to diagnose which specific comments had invalid line numbers.
This change adds detailed error logging to the
Post Reviewstep's catch block in the review-pr workflow:error.response.data.errors(the array of specific validation errors from GitHub)error.response.dataobjectThis will make it much easier to debug issues like REMOTE-1115 where comments reference lines that can't be resolved in the PR diff.
Changes
examples/review-pr.yml— Added detailed GitHub API error logging in the catch block.github/workflows/review-pr.yml— Regenerated from the exampleConversation: https://staging.warp.dev/conversation/e0d991b8-39dd-4d78-85e3-c621fc1fcd2a
Run: https://oz.staging.warp.dev/runs/e3f0715f-e937-4b02-a7c4-dfa07927508f
This PR was generated with Oz.