Skip to content

PR review: Analyze diffs and post review comments #2

@nev-offload

Description

@nev-offload

Problem

When triggered by PR events, the agent should review the PR diff and post meaningful review comments.

Expected behavior

  • On pull_request.opened or pull_request.synchronize, fetch the PR diff
  • Pass the diff to the agent as context along with the repo's conventions
  • Agent posts a PR review (not just a comment) with inline comments on specific lines
  • Support approve/request-changes/comment review types

Implementation notes

  • Use octokit.pulls.get() with mediaType: { format: "diff" } to get the diff
  • Use octokit.pulls.createReview() to post structured reviews with line comments
  • Include file context (not just the diff hunks) for better review quality
  • Consider a .openclaw.yml config for review preferences (style, strictness, focus areas)
  • Rate limit: don't review every push, maybe only on request or first push

Priority

P1 — Key feature for the GitHub App use case, but depends on #1 (response posting) being done first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions