Summary
When a workflow is triggered by an issue_comment event on a pull request and the agent emits submit_pull_request_review with a body and event: COMMENT but no preceding create_pull_request_review_comment items, the review is silently dropped with the warning:
No review context set - cannot submit review
✗ Failed to submit PR review: No review context available
The job ends in success, but nothing is posted to the PR.
Root cause
The asymmetry is between two handlers in actions/setup/js/:
create_pr_review_comment.cjs:192-204 correctly handles issue_comment triggers on PRs by reading context.payload.issue.pull_request / context.payload.issue.number directly.
submit_pr_review.cjs:130-138 routes through resolveTarget in safe_output_helpers.cjs. With supportsPR: false, supportsIssue: false, the "triggering" branch at lines 102-110 rejects whenever !isPRContext, and isPRContext covers only pull_request{,_target,_review,_review_comment} — not issue_comment. The fallback returns shouldFail: false so it doesn't even warn loudly, then submitReview() warns that there's no review context.
pr_review_buffer.cjs:218-220 explicitly documents that body-only reviews are supported ("Supports body-only reviews (no inline comments) when metadata is set"), so this is a real bug, not an intentional limitation. It only manifests when the agent decides not to leave any inline comments — common for bot reviewers on clean PRs.
Reproduction
-
Workflow with this safe-outputs config:
safe-outputs:
create-pull-request-review-comment:
max: 20
submit-pull-request-review:
max: 1
target: \"triggering\"
allowed-events: [COMMENT]
on:
command:
name: my-review
-
PR-menu/slash-command trigger fires an issue_comment event on the PR.
-
Agent finds no actionable inline issues and emits a single submit_pull_request_review with body + event: COMMENT.
-
Result: safe_outputs job succeeds, two warnings as above, no review posted.
A real run that hit this: https://github.com/elastic/docs-content/actions/runs/25541964378 (gh-aw v0.71.5, but the same code paths exist on main and on every 0.71.x / 0.72.x).
Proposed fix
Make submit_pr_review.cjs mirror create_pr_review_comment.cjs: when the trigger is issue_comment and context.payload.issue.pull_request is present, treat the comment's parent PR as the review context. Either:
- Extend
isPRContext in safe_output_helpers.cjs to include issue_comment events whose payload has issue.pull_request, or
- Add the same
issue.pull_request fallback in the body-only branch of submit_pr_review.cjs lines 130-190 before going through resolveTarget.
Either change would also let the autogenerated review fallback at the end of run ("buffered comments are still submitted as a COMMENT review automatically") work for issue_comment triggers when the buffer is empty but metadata was set.
Workaround
For now, downstream workflows can fall back to add-comment (which does correctly handle issue_comment on PRs in add_comment.cjs:495-502 via supportsPR: true) when the agent has no inline findings. That posts the summary as a regular PR comment instead of a review.
Summary
When a workflow is triggered by an
issue_commentevent on a pull request and the agent emitssubmit_pull_request_reviewwith a body andevent: COMMENTbut no precedingcreate_pull_request_review_commentitems, the review is silently dropped with the warning:The job ends in
success, but nothing is posted to the PR.Root cause
The asymmetry is between two handlers in
actions/setup/js/:create_pr_review_comment.cjs:192-204correctly handlesissue_commenttriggers on PRs by readingcontext.payload.issue.pull_request/context.payload.issue.numberdirectly.submit_pr_review.cjs:130-138routes throughresolveTargetinsafe_output_helpers.cjs. WithsupportsPR: false, supportsIssue: false, the "triggering" branch at lines 102-110 rejects whenever!isPRContext, andisPRContextcovers onlypull_request{,_target,_review,_review_comment}— notissue_comment. The fallback returnsshouldFail: falseso it doesn't even warn loudly, thensubmitReview()warns that there's no review context.pr_review_buffer.cjs:218-220explicitly documents that body-only reviews are supported ("Supports body-only reviews (no inline comments) when metadata is set"), so this is a real bug, not an intentional limitation. It only manifests when the agent decides not to leave any inline comments — common for bot reviewers on clean PRs.Reproduction
Workflow with this safe-outputs config:
PR-menu/slash-command trigger fires an
issue_commentevent on the PR.Agent finds no actionable inline issues and emits a single
submit_pull_request_reviewwith body +event: COMMENT.Result:
safe_outputsjob succeeds, two warnings as above, no review posted.A real run that hit this: https://github.com/elastic/docs-content/actions/runs/25541964378 (gh-aw v0.71.5, but the same code paths exist on main and on every 0.71.x / 0.72.x).
Proposed fix
Make
submit_pr_review.cjsmirrorcreate_pr_review_comment.cjs: when the trigger isissue_commentandcontext.payload.issue.pull_requestis present, treat the comment's parent PR as the review context. Either:isPRContextinsafe_output_helpers.cjsto includeissue_commentevents whose payload hasissue.pull_request, orissue.pull_requestfallback in the body-only branch ofsubmit_pr_review.cjslines 130-190 before going throughresolveTarget.Either change would also let the autogenerated review fallback at the end of run ("buffered comments are still submitted as a COMMENT review automatically") work for
issue_commenttriggers when the buffer is empty but metadata was set.Workaround
For now, downstream workflows can fall back to
add-comment(which does correctly handleissue_commenton PRs inadd_comment.cjs:495-502viasupportsPR: true) when the agent has no inline findings. That posts the summary as a regular PR comment instead of a review.