Skip to content

submit_pull_request_review with depends-on a buffered review comment is skipped, and the comment is posted in a footer-only review #77220

Done

Description

@ekbritecore

Analysis

On gh-aw v1.2.0 (engine pi, handler-managed safe outputs), an agent that calls create_pull_request_review_comment and then submit_pull_request_review with depends-on set to the comment's output_id never gets its review submitted. The safe_outputs job publishes the buffered inline comment in a review whose body is only the gh-aw footer, then fails the real submit_pull_request_review with "Safe-output prerequisite did not complete successfully". The real review body is lost. Observed 7 times in 4 days on one repository.

agent_output.json holds the two items; the second carries "depends-on": "<output_id of the first>":

{"type": "create_pull_request_review_comment", "output_id": "so_aaaaaaaaaaaa", "path": "a.js", "line": 133, "body": "...", "pull_request_number": 1}
{"type": "submit_pull_request_review", "output_id": "so_bbbbbbbbbbbb", "depends-on": "so_aaaaaaaaaaaa", "event": "COMMENT", "body": "### Summary\n...", "pull_request_number": 1}

safe_outputs job log (repository and PR number replaced):

Processing 2 message(s) in order of appearance...
Processing message 1/2: create_pull_request_review_comment
Buffered review comment 1: a.js:133
✓ Message 1 (create_pull_request_review_comment) completed successfully

=== Finalizing PR Review for <repo>#<n> ===
Submitting 1 buffered review comment(s) for <repo>#<n>
Submitting PR review on <repo>#<n>: event=COMMENT, comments=1, bodyLength=451
Created PR review #...: https://github.com/<repo>/pull/<n>#pullrequestreview-...
✓ PR review submitted for <repo>#<n>

=== Processing Summary ===
Status: partial_success
Successful: 0
Failed: 1
Skipped (no context or limit reached): 1
  Types: create_pull_request_review_comment
##[error]1 safe output(s) failed:
  - submit_pull_request_review: Safe-output prerequisite did not complete successfully

The posted review's body is the footer only (bodyLength=451), so the real Summary never reaches the PR.

Cause, from reading safe_output_dependencies.cjs: isConfirmedDependencySuccess rejects a buffered record. The comment is only buffered until the review is finalized, and the review is what publishes it. So a submit_pull_request_review that depends on a buffered comment can never become ready: the prerequisite can only be confirmed by the submit it blocks. The finalizer then still publishes the buffered comments, in a review with no body.

This is the reverse of #75293 (a dependent of the review, fixed by #75387, which is in v1.2.2). #75387's documentation says create_pull_request_review_comment "can be prerequisites", but a review that depends on one of its own comments is circular and is not covered. I did not run v1.2.2 on this case.

Related: a second failure in the same family: nothing stops the agent from setting depends-on here, because every safe-output tool advertises it (--depends-on in the CLI help).

Implementation Plan

  1. In the dependency plan, treat a create_pull_request_review_comment prerequisite of a submit_pull_request_review for the same PR as satisfied by the review's own submission (the comment is part of that review), or reject the dependency at call time with a clear error.
  2. If a dependency cannot be honoured, do not post the buffered comments in a bodyless review: fail the whole review batch, or skip the footer-only submit, so the PR does not get an empty review.
  3. Document in the safe-outputs reference that a review must not depend on its own inline comments.

Acceptance Criteria

  • A submit_pull_request_review with depends-on pointing at a create_pull_request_review_comment of the same review either submits one review with the comments and the body, or is rejected at the tool call. It never posts a review with the footer only.
  • A regression test covers comment then review with depends-on.

Activity

  1. locked and limited conversation to collaborators on Nov 12, 2026
  2. unlocked this conversation on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions