Goal
Add a new tool gh_pr_review that fetches and displays review comments on a GitHub pull request, including approval state and review bodies. Mirrors the existing gh_pr_status / gh_pr_comment patterns.
Background
Currently the supertools plugin can add a PR comment (gh_pr_comment) and check PR status (gh_pr_status), but cannot fetch existing review comments. Code-reviewer subagents and humans need to inspect bot findings (e.g. copilot, codereviewer) without scraping gh pr view via bash — saves ~90% tokens.
Acceptance Criteria
Implementation Notes
- Use
gh pr view <N> --json comments,reviews — confirmed both fields exist in CLI
- Note:
comments field contains issue-level (timeline) comments only; path/line are NOT present (those are inline review comments, separate GraphQL query — out of scope for v1)
- Follow existing pattern from
gh-pr-comment.ts: runGh + resolveRepo from ../lib/gh-utils
- Use positional
resolveRepo(repo, ctx.directory) — matches the existing call signature in gh-pr-comment.ts
Goal
Add a new tool
gh_pr_reviewthat fetches and displays review comments on a GitHub pull request, including approval state and review bodies. Mirrors the existinggh_pr_status/gh_pr_commentpatterns.Background
Currently the supertools plugin can add a PR comment (
gh_pr_comment) and check PR status (gh_pr_status), but cannot fetch existing review comments. Code-reviewer subagents and humans need to inspect bot findings (e.g. copilot, codereviewer) without scrapinggh pr viewvia bash — saves ~90% tokens.Acceptance Criteria
src/tools/gh-pr-review.tsexportsghPrReviewTool{ pr: number, repo?: string }logDebugEventsrc/four-opencode-supertools.tsasgh_pr_reviewbun run buildImplementation Notes
gh pr view <N> --json comments,reviews— confirmed both fields exist in CLIcommentsfield contains issue-level (timeline) comments only; path/line are NOT present (those are inline review comments, separate GraphQL query — out of scope for v1)gh-pr-comment.ts:runGh+resolveRepofrom../lib/gh-utilsresolveRepo(repo, ctx.directory)— matches the existing call signature ingh-pr-comment.ts