feat(triggers): expand respond-to-review to also fire on COMMENT-type reviews#646
Merged
zbigniewsobiecki merged 1 commit intodevfrom Mar 7, 2026
Merged
Conversation
nhopeatall
approved these changes
Mar 7, 2026
Collaborator
nhopeatall
left a comment
There was a problem hiding this comment.
LGTM — Clean, well-scoped change that broadens the review trigger to fire on commented-state reviews in addition to changes_requested.
Verified:
- The
matches()logic change from!== 'changes_requested'→=== 'approved'correctly excludes only approvals (dismissals are already filtered by theaction !== 'submitted'guard above) - No infinite loop risk: the
handle()persona guard (line 61) ensures only reviews from thereviewerpersona trigger the agent, whilerespond-to-reviewruns asimplementer - The
check-suite-success.tsdedup logic that filters outCOMMENTEDreviews is unaffected and intentionally separate - The null-body fallback (
Review: ${state}) works correctly for thecommentedstate - All 16 tests pass, covering both
matchesandhandlefor the new states
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
PRReviewSubmittedTrigger.matches()to accept bothchanges_requestedandcommentedreview states, excluding onlyapproved(dismissed reviews are already excluded by theaction !== 'submitted'guard)commented-state assertion fromfalsetotrue, add a newmatchestest for dismissed state, and add two newhandletests coveringcommented-state triggering and its null-body fallbackrespond-to-review.yamltrigger description to reflect the broader scopeCard: https://trello.com/c/69ac12414c2917eab39385fc
Changed files
src/triggers/github/pr-review-submitted.ts!== 'changes_requested'check with=== 'approved'check; update inline commentstests/unit/triggers/pr-review-submitted.test.tscommentedstate assertion; add dismissed/commented handle testssrc/agents/definitions/respond-to-review.yamlSafety analysis
respond-to-reviewruns as theimplementerpersona; the trigger requires thereviewerpersona. The guard inhandle()is unchanged.check-suite-success.tsdedup logic that filters outCOMMENTEDreviews is unrelated and intentionally unchanged.Test plan
matches()returnstrueforchanges_requestedandcommentedmatches()returnsfalseforapprovedanddismissed(action-filtered)handle()returns correctTriggerResultforcommentedstate from reviewer personahandle()usesReview: commentedfallback when body is null🤖 Generated with Claude Code