Repository navigation
Make the @claude PR review a panel of three independent reviewers - #24120
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/24120
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 1 PendingAs of commit c876784 with merge base 703a411 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
1ef40ac to
5292c27
Compare
5292c27 to
b8109d1
Compare
Today @claude /pr-review is one reviewer making one pass at the default effort level. A single pass misses things, and nothing separates real problems from noise. The review now runs three blind reviewer sub-agents with the same brief, each reading the code itself within a small tool call budget. Each reviewer names the changed files it did not reach, and the main session reviews those itself or says they were not reviewed. The main session merges their findings, notes how many reviewers found each one, checks every finding it would post against the code, and posts one review in the existing format. For comments that start with "@claude /pr-review" the workflow passes --effort max, which the reviewer sub-agents inherit; other @claude runs keep the default. Reviewers run in the foreground, because background sub-agents are stopped when a non-interactive run ends its turn. The skill no longer asks for extra investigation or fact-check sub-agents, which made a higher-effort review far slower and more expensive.
b8109d1 to
c876784
Compare
| uses: pytorch/test-infra/.github/workflows/_claude-code.yml@main | ||
| with: | ||
| additional_claude_args: --allowedTools Skill | ||
| additional_claude_args: --allowedTools Skill ${{ startsWith(github.event.comment.body, '@claude /pr-review') && '--effort max' || '' }} |
There was a problem hiding this comment.
@atalman is effort max ok here? How do we watch budget of this
Review requests got --effort max only when the comment started with "@claude /pr-review". This also gives max effort to comments that start with "@claude review". It changes a choice pytorch#24120 made: that PR kept plain-language review requests at the default effort, and measured max effort reviews at 11 to 21 minutes and about 14 to 17 times the tokens, against 1 to 2 minutes at default. The match is a case-insensitive prefix, so "@claude please review" stays at the default. Every other request, such as the pin bump's [ci-fix-attempt] runs, questions and new issues, keeps the default effort.
Summary
Today
@claude /pr-reviewis one reviewer making one pass at the default effort level. One pass misses things and cannot tell real problems from noise.This change turns the review into a small panel:
For comments that start with
@claude /pr-review, the workflow also passes--effort max. The reviewer sub-agents inherit it: in a local run, their requests carried the same max effort as the main session. Other@clauderuns, such as questions, plain-language review requests and the automated CI fix attempts, keep the default effort.Reviewers run in the foreground, because a non-interactive run stops background sub-agents when its turn ends. The skill also drops its extra investigation and fact-check sub-agents, which made a max-effort review far slower (see the test plan).
Test plan
Ran Claude Code locally with the tools, model (Opus 5.5) and settings the workflow passes, on two open PRs (a runtime change and an XNNPACK change), read only.
Both fit easily in the 60 minute job timeout, which stays as is.
Both panel reviews caught the main problems the single pass found and added real ones it missed: on the XNNPACK PR, the new test feeds the wrong input under the current Python bindings; on the runtime PR, a missing null check still crashes the load path the PR hardens. A single pass at max effort also found that null check, but took twice as long and about four times the tokens of the panel.
The workflow change itself only runs after merge, since
@clauderuns frommain. The action also loads.claude/frommain, so every PR gets the new skill and the new effort setting together. The shared workflow pins Claude Code 2.1.280, which already supports--effort max.