@bizmyth/pi-address-review-comments0.3.3
A supervised GitHub PR review-comment workflow for the Pi coding agent
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
@bizmyth/pi-address-review-comments
A supervised GitHub PR review-comment workflow for the Pi coding agent.
What it does
/address-review-comments fetches every unresolved review thread on a pull request, hands the agent a
read-only snapshot of that context, and then requires a human decision — in a TUI dialog — before any
reply is posted or any thread is resolved.
The extension, not the agent, talks to GitHub. While a workflow is active, the agent is blocked from fetching or mutating review threads itself, so the only path to a posted comment runs through the checkpoint dialog.
Requirements
ghauthenticated for the repository (gh auth login).git, with the pull request's head branch available locally or checkoutable bygh pr checkout.- The interactive TUI. The checkpoint tool refuses to run headless, because approval is mandatory.
Install
pi install npm:@bizmyth/pi-address-review-comments
Restart Pi after installation. Review extensions before installing them; Pi extensions run with your full user permissions.
Usage
/address-review-comments [PR_NUMBER] [--author-comments]
/gh-review-comments [PR_NUMBER] [--author-comments]
Without a PR number, the pull request is inferred from the current branch. /gh-review-comments is an
alias for projects that already define their own address-review-comments command.
Threads where the PR author is the only participant are skipped by default; --author-comments keeps
them. Threads the author opened that a reviewer later joined are always in scope.
On start the extension:
- Resolves the repository and pull request, checking out the head branch when the worktree is clean.
- Fetches unresolved review threads, top-level review summaries, and stack context (when the PR is
part of a GitHub stack) through the
ghGraphQL API. - Writes
command-request.json,fetch-request.json,fetch-response.json, andauthored.diffinto a temporary artifact directory, leaving generated files out of the diff. - Sends the agent a prompt pointing at those artifacts, with the rules for the workflow.
A status entry shows the remaining thread count, and the workflow survives /reload and session
resume through session entries.
The checkpoint
For every thread, the agent must call the github_review_checkpoint tool. The reviewer, location,
agent analysis, and exact draft reply are rendered into the transcript, and a compact action picker
opens in the editor area below it:
| Action | Effect |
|---|---|
resolve |
Post the reply and resolve the thread |
post |
Post the reply, leave the thread open |
edit |
Send instructions for rewording the draft, then checkpoint again |
feedback |
Send feedback for the agent to address in code and draft, then checkpoint again |
skip |
Post nothing; the agent reverts that thread's changes |
abort |
Stop the workflow and summarize |
Pick with ↑↓ or 1-6, then Enter to confirm or Esc to abort; dismissing the picker counts as
abort.
Interactive preview
Run bun run mock to launch a real interactive pi agent against a disposable repository with two
synthetic review threads. It uses your normal configured model, but disables GitHub CLI access and
replaces reply submission with a local mock backend. Each run recreates .mock/repo; checkpoint
decisions remain available in .mock/actions.jsonl after pi exits.
Additional pi options can be forwarded after --, for example:
bun run mock -- --model sonnet --tui-mode fullscreen
Every posted reply gets a standardized footer identifying the agent and its human supervisor:
> `pi` agent using `address-review-comments`, supervised by @your-login
The footer is stripped again when review threads are read back, so it never clutters the agent's context.
Generated files
Generated files are left out of the authored diff so the agent reviews only hand-written changes.
Which files count comes from the repository itself: git check-attr linguist-generated against your
.gitattributes, the same attribute GitHub uses to collapse generated files in a pull request diff.
*.pb.go linguist-generated=true
web/src/api/gen/** linguist-generated
Nothing is dropped in a repository without those attributes, and a repository that already marks its codegen for GitHub needs no extra setup. If the lookup fails, the command warns and keeps the full diff.
Configuration
Configuration is optional and has a single key. Pi reads .pi/extensions/address-review-comments.json
in the project, falling back to ~/.pi/agent/extensions/address-review-comments.json.
{
"botLogins": ["house-review-bot"]
}
botLogins names review bots that GitHub reports as ordinary users, so their comments are flagged as
bot-authored. Accounts GitHub types as Bot or whose login ends in [bot] are detected automatically,
as are several common hosted reviewers.
While a workflow is active, direct gh pr view, gh pr diff, and review-thread GraphQL calls are
blocked no matter how the extension is configured.
Development
bun install
bun run check
bun run check runs Biome, TypeScript 7 (tsc, the Go-based compiler), and Bun tests. The tests are
hermetic: GitHub access is faked through an injected command executor.
Releasing
Trusted publishing must already be configured for publish.yml. To release a new version:
bun pm version patch # or: minor / major
git push origin main --follow-tags
gh release create "$(git describe --tags --exact-match)" --generate-notes
Publishing the GitHub release runs the checks and publishes the matching package version to npm using OIDC. No long-lived NPM_TOKEN is required.
License
MIT