Skip to content

Agent review-body commands can be cancelled by sibling inline review-comment events #75

Description

@lolipopshock

Summary

Submitting a GitHub PR review with both a top-level @sepo-agent command and inline review comments can cause the actual agent invocation to be cancelled before it reaches the router.

Observed example

On PR #66, review pullrequestreview-4207425242 contained:

@sepo-agent /answer

i haven't fully finished but can you explain to me how this function is structured? ...

GitHub created several Agent Entrypoint runs at the same time:

  • pull_request_review run 25205475805cancelled
  • three pull_request_review_comment runs — skipped because the inline comments did not contain a live agent mention

As a result, the review-body agent command was not picked up.

Why this happens

agent-entrypoint.yml currently uses a concurrency group keyed mostly by target kind and target number:

agent-${{ github.repository }}-${{ ...kind... }}-${{ ...number... }}

For a PR review submission with inline comments, GitHub emits multiple webhook events nearly simultaneously:

  • pull_request_review for the top-level review body
  • pull_request_review_comment for each inline comment

Those events all share the same PR-number-based concurrency group. Even with cancel-in-progress: false, GitHub Actions only keeps one pending run per concurrency group, so sibling no-mention inline-comment runs can replace/cancel the pending review-body run before it reaches agent-router.yml.

Impact

Agent invocation from top-level PR review bodies is nondeterministic when the review also includes inline comments. Whether the agent responds depends on event ordering and whether the review-body run starts before sibling comment runs are queued.

Standalone inline review comments with @sepo-agent are still expected to work; the problematic route is the bundled "submit review" path with top-level mention plus inline comments.

Suggested fix

Make Agent Entrypoint concurrency event/comment/review-specific, or otherwise avoid applying target-wide concurrency before mention validation. For example, include identifiers such as:

  • github.event_name
  • github.event.review.id for pull_request_review
  • github.event.comment.id for comment events
  • fallback to github.run_id when no stable event object id exists

The goal is that no-mention sibling pull_request_review_comment events cannot cancel a mention-bearing pull_request_review event.

Acceptance criteria

  • Submitting a PR review with a top-level @sepo-agent /answer and several inline comments reliably dispatches the agent route.
  • Sibling inline review-comment events without mentions may skip, but must not cancel the top-level review-body run.
  • Add regression coverage for entrypoint concurrency key generation or equivalent workflow assertions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumProject management: medium effortpriority/p1Project management: high priority

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions