Skip to content

Code Review Action: openlibrary-bot-driven PR review (Copilot replacement) #13163

Description

@mekarpeles

Summary

Build a GitHub Action, using the same Claude-token pattern as issue enrichment (#13075) and the planned PR auto-responder (#13162), that gives PRs an automated code review similar to what GitHub Copilot used to provide before free Copilot credits for OSS maintainers were discontinued. Sub-task of #13160.

Trigger

When @openlibrary-bot is added a PR reviewer, or

Staff-only, for security:

  • at-mentioning @openlibrary-bot directly in a PR comment

The permission-gate bypass problem found in #13161 hopefully doesn't apply here, but should be verified once this is built rather than assumed. It should work at least for me...

Behavior

  • Post inline suggestion-style comments on specific code blocks/lines, similar to Copilot's review UX (not just a single summary comment).
  • On re-trigger for the same PR, review only the diff since its last review pass — not the whole PR again. Needs a persisted "last reviewed SHA" marker, likely reusing the <!-- ol-pr-bot -->-style idempotency marker convention already used in pr-prereview.md.
  • Must ignore openlibrary-bot's own prior comments/actions when re-triggered, to avoid the same class of feedback-loop bug as openlibrary-bot comments trigger "Needs: Response" labeling #13138.
  • Maps onto the existing Revere identity/role (deep code review across correctness, security, a11y, tests, style — see pm repo AGENTS.md) — the gap being closed here is automation transport, not review logic. Findings should follow the same safety rules as pr-prereview.md (no value judgments, never mention Claude/Anthropic, idempotency guard).

Research needed before design

  • How does Copilot structure its inline review comments technically (REST/GraphQL shape for line-anchored suggestions)? Needed to know what's achievable via gh api / claude-code-action vs. what needs a custom script.
  • Confirm whether anthropics/claude-code-action supports posting line-anchored review comments natively, or whether this needs direct GitHub Review API calls (POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews with comments[]) wrapped around it.

Related

Metadata

Metadata

Assignees

Labels

Affects: ConfigurationRelated to the configuration of the dev/staging/prod environments, CI, docker, etc. [managed]Needs: InvestigationThis issue/PR needs a root-cause analysis to determine a solution. [managed]Needs: LeadNeeds: Staff / InternalReviewed a PR but don't have merge powers? Use this.Theme: BotsIssues relating to Bots & data cleanupType: Feature RequestIssue describes a feature or enhancement we'd like to implement. [managed]Type: Subtask of EpicA subtask that is part of the work breakdown of an epic issue (see comments). [managed]

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions