Skip to content

kew review

Gather PR review comments and dispatch the configured runner to address them.

Standalone review supports runners that require host-publication, including official Codex. The runner receives no commit, push, or GitHub mutation authority; after a successful run, Kew commits the remediation and pushes the existing PR branch from the host. A failed publication preserves the worktree and returns non-zero. The governed adversarial-review path remains externally contained and uses OpenCode.

Usage: kew review [OPTIONS] PR_NUMBER

Arguments:
  PR_NUMBER       PR number to review (required)

Options:
  --author TEXT    Filter comments by author
  --dry-run       Show comments without dispatching

kew review demo

What it does:

  1. Fetches PR metadata and links the originating issue
  2. Collects review comments, inline suggestions, and issue comments
  3. Filters out resolved threads (via GraphQL) and bot comments
  4. Builds a structured review prompt from the review.md.j2 template
  5. Materializes a dedicated review checkout at <worktree_base>/review/pr-<n>
  6. Dispatches the configured runner to address each comment
  7. For host-publication runners, commits and pushes the existing PR branch
  8. Records a durable review.outcome audit event and notifies it

Review checkouts never collide with implementation work. The review checkout is its own directory — never the agent/issue-* worktree an implementation agent may still be writing to. Before materializing, kew looks for a worktree that already has the exact PR branch checked out; when it finds one, the review runs detached at the PR head instead of creating a second local branch (which used to abort the review with a git exit 255). A dirty implementation checkout is never reset, cleaned, overwritten, or shared, and two concurrent reviews of the same PR do not share a tree — the second one refuses.

Publication is bound to the PR head the review was cut from: if the head moved while the runner worked, kew refuses to push rather than publishing over a state nobody reviewed, and preserves the checkout.

Outcomes survive the process. Completion and failure — including a failure before the runner ever launches — are persisted to the audit trail and pushed to the configured notifier, so a kew review run needs no attached watcher:

kew audit tail --event review.outcome

Examples:

# Preview review comments without dispatching
kew review 42 --dry-run

# Dispatch agent to address all review comments
kew review 42

# Only address comments from a specific reviewer
kew review 42 --author octocat