feat(ai-review): state-aware PR verdict, explicit APPROVE/REQUEST_CHANGES#4
Merged
Merged
Conversation
…NGES Previously the prompt told Codex to "post a concise positive review" when clean, without specifying the GitHub review event. Codex defaulted to event=COMMENT, which doesn't satisfy branch protection's "needs an approval" gate — so even clean re-reviews never unblocked merge. Two changes to the PR-mode section of the prompt: 1. Before deciding, the bot now fetches the PR's existing review threads and treats resolved ones as previously-handled. It won't re-raise a finding the maintainer already chose to close. 2. Explicit event mapping: - event=APPROVE when no actionable issues remain - event=REQUEST_CHANGES only for new unaddressed issues - event=COMMENT for informational-only reviews End result: first run finds an issue → REQUEST_CHANGES. Author fixes and resolves the thread. Push triggers re-review → bot sees thread resolved + no new issues → APPROVE → branch protection cleared.
There was a problem hiding this comment.
Reviewed the workflow prompt update in .github/workflows/ai-review.yml.
No actionable correctness, security, or regression issues found in this change. The new instructions are consistent with the intended PR re-review behavior (explicit event selection and handling of resolved threads).
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
event=APPROVEwhen no actionable issues remain (this is what unblocks branch protection's "needs an approval" gate on clean re-reviews)event=REQUEST_CHANGESonly for new unaddressed issuesevent=COMMENTfor informational-only reviewsWhy
Previously the prompt said "post a concise positive review" when clean, without specifying the event. Codex defaulted to event=COMMENT, which doesn't satisfy branch protection's approval requirement. A PR could have all its review threads resolved and still be blocked indefinitely, because the bot never flipped its verdict to APPROVE.
Real-world example: jitsucom/jitsu#1289 — six bot review threads, all resolved (code fixes for some, maintainer "too much" rationale on one). Bot kept posting CHANGES_REQUESTED on subsequent runs because each fresh run re-evaluated the diff without context from the resolved threads. PR had to be unblocked via admin review-dismissal — a manual workaround for a fixable prompt issue.
After this change
Test plan