Repository navigation
fix: dedupe codex autofix by concrete review id - #8
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 076ca2ef34
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| fi | ||
|
|
||
| if [ -z "$REVIEW_ID" ]; then | ||
| REVIEW_ID=$(gh api "repos/$GITHUB_REPOSITORY/pulls/$PR/reviews" --paginate --jq ' |
There was a problem hiding this comment.
Use --slurp when paginating review lookup
When a PR has enough reviews to span multiple API pages, gh api --paginate --jq ... can emit one selected review ID per page, so REVIEW_ID=$(...) may contain multiple newline-separated IDs instead of one. That multi-line value is then written via echo "review_id=$REVIEW_ID" >> "$GITHUB_OUTPUT", which can corrupt step outputs (or later produce an invalid pulls/<pr>/reviews/<id>/comments path), causing /codex-fix runs to fail on long-lived PRs. Collapse paginated data into a single JSON stream (e.g., --slurp) or explicitly pick one ID after pagination.
Useful? React with 👍 / 👎.
Summary
review_idreview-<id>) instead of static fallback collisions--body-file) and avoid heredoc parse pitfallsWhy
This fixes the codex finding where
/codex-fixcould be blocked after one run because dedupe used a static marker whenreview_idwas empty.Verification