Skip to content

Let "effort=max" in an @claude comment or new issue opt into max effort - #24275

Open
shoumikhin wants to merge 1 commit into
pytorch:mainfrom
shoumikhin:claude-review-max-effort
Open

shoumikhin wants to merge 1 commit into
pytorch:mainfrom
shoumikhin:claude-review-max-effort

Conversation

@shoumikhin

@shoumikhin shoumikhin commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

What is wrong today

Claude runs at max effort only when a comment starts with @claude /pr-review. Every other request, such as a question, an investigation or a code change, runs at the default effort, and there is no way to ask for more.

What this change does

A comment that contains effort=max, or a new issue whose body contains it, now also runs at max effort, the same opt-in pytorch/pytorch uses:

@claude why does this test fail on Windows?             # default effort
@claude why does this test fail on Windows? effort=max  # max effort

What this does and does not change:

  • Reviews: nothing new. Every review request already goes through the /pr-review skill, so @claude review effort=max runs the same as @claude /pr-review.
  • Other requests: the real change. Questions, investigations and code changes can now run at max effort. Their run time at max effort has not been measured yet.
  • Matching. effort=max counts anywhere in the comment, also in a quoted reply. No other level, such as effort=high, is recognized. A comment in the workflow file says this.
  • New issues. The issue body is read only on issue events. On a comment it holds the issue or PR description, so a description that mentions effort=max would otherwise raise every comment there to max effort.

Max effort stays opt-in because it is slow. In recent runs on this repository, max effort reviews took 14 to 58 minutes, against 4 to 8 minutes at the default. The job is stopped after one hour, when its credentials expire, and a run stopped there posts nothing. So a long request at max effort can lose its answer.

Tests

This workflow runs from the main branch for comment and issue events, so no check on this pull request runs the new condition.

  • actionlint 1.7.12 reports no problems in the workflow file.
  • A Python copy of the condition, following GitHub's expression rules (case-insensitive contains and startsWith, missing fields read as empty strings), gives the expected effort for these sample events:
Event Comment Issue or PR body Effort
comment @claude review mentions effort=max default
comment @claude review effort=max plain max
comment @claude /pr-review plain max
comment @claude why is this slow? effort=max plain max
comment @claude explain empty default
new issue none @claude investigate this crash effort=max max
new issue none @claude investigate this crash default
  • After merge: in the "Run Claude Code" step's log, an @claude ... effort=max comment should show --effort max in the Claude arguments, and a plain @claude comment should not.

Copilot AI balanced review requested due to automatic review settings October 29, 2026 06:33
@pytorch-bot

pytorch-bot Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/24275

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 8da32cd with merge base 7586c16 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 29, 2026
@shoumikhin shoumikhin added topic: not user facing release notes: none Do not include this in the release notes labels Oct 29, 2026
@shoumikhin
shoumikhin force-pushed the claude-review-max-effort branch from 051675f to 987584d Compare October 29, 2026 23:48
Copilot AI balanced review requested due to automatic review settings October 29, 2026 23:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@shoumikhin
shoumikhin force-pushed the claude-review-max-effort branch from 987584d to c8a10b1 Compare October 30, 2026 02:02
Copilot AI balanced review requested due to automatic review settings October 30, 2026 02:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@shoumikhin shoumikhin changed the title Run "@claude review" at max effort too Let "effort=max" in an @claude comment opt into max effort Oct 30, 2026
@shoumikhin

Copy link
Copy Markdown
Contributor Author

@claude /pr-review

@claude

claude Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Claude finished @shoumikhin's task in 13m 54s —— View job


For review requests effort=max only duplicates @claude /pr-review, so the change's real effect is max effort on non-review requests, which the description doesn't cover; the new check also has minor gaps in matching, issue handling, and documentation.

Detailed review

PR Review: #24275

Summary

Adds contains(github.event.comment.body, 'effort=max') as a second way to get --effort max, alongside the @claude /pr-review prefix. Line 15 already sends every review request to the /pr-review panel, so this does not provide the deeper review without the panel that the description asks for. The new effect, max effort on requests that aren't reviews, is not discussed. The keyword also matches more loosely than the /pr-review check, is ignored in new issues, is not documented anywhere, and cannot be tested before merge.

API Design

  • For reviews, effort=max is a second spelling of /pr-review, so the stated problem remains (.github/workflows/claude-code.yml:13, with :15).
    • Line 15 sends every review request to the /pr-review skill, which always runs the three-reviewer panel at the caller's effort (.claude/skills/pr-review/SKILL.md:129, :154).
    • So @claude review effort=max runs the same max-effort panel as @claude /pr-review. There is still no way to get a deeper review without the panel.
    • The only new behavior is max effort for requests that aren't reviews: questions, investigations, code changes. The description neither mentions nor times these runs.
    • Unlike panel reviewers, these runs have no tool-call budget, so they are the most likely to approach the one-hour limit the description cites. The reusable workflow also defaults timeout_minutes to 60 (pytorch/test-infra .github/workflows/_claude-code.yml:19-22), and this caller doesn't override it.
    • Fix: either rewrite the description and commit message around non-review requests, or, if a single-pass deeper review was the goal, change line 15 instead of the effort flag.
  • effort=max matches anywhere in the comment, unlike the /pr-review check beside it (:13).
    • contains() matches the text anywhere in the comment, and the reusable workflow starts Claude whenever @claude appears anywhere in the body (_claude-code.yml:78).
    • So both of these run at max effort: a quote-reply to an earlier @claude review effort=max comment, and a question like @claude what does effort=max do?.
    • The startsWith check doesn't have this problem, because a quoted > @claude /pr-review doesn't match it.
    • Fix: anchor the new check the same way, for example startsWith(github.event.comment.body, '@claude effort=max'), which changes the syntax to @claude effort=max <request>. Alternatively, keep the loose match on purpose and document it.
  • Only the exact token effort=max is recognized, and nothing documents it (:13).
    • The key=value form suggests other levels work, but effort=high, effort: max and --effort max all silently run at default.
    • @claude /pr-review effort=low still runs at max.
    • Line 13 is the only place in the repo that mentions the keyword. The GitHub Actions Mode section of SKILL.md:81-85 covers only @claude /pr-review.
    • Fix: add a one-line comment above line 13 that gives the accepted token and says /pr-review always implies max. Fix this →

Infrastructure

  • effort=max in a new issue is silently ignored (:6-7, :13).
    • For issues events, the reusable workflow starts Claude from github.event.issue.body (_claude-code.yml:79).
    • So an issue opened with @claude investigate this crash effort=max does start a run, but at default effort, because line 13 reads only github.event.comment.body.
    • Fix, unless this is intended: copy the reusable workflow's event-type check: contains(github.event_name == 'issues' && github.event.issue.body || github.event.comment.body, 'effort=max'). Fix this →
    • Don't read github.event.issue.body without that check. On PR comments it holds the PR description, and this PR's description contains effort=max, so every @claude comment here would run at max. _claude-code.yml:66-68 describes the same trap.

Testing

  • Nothing tests the new expression before merge, although the description says "CI's workflow checks run on this change".
    • The workflow triggers only on issue_comment and issues (:3-7). GitHub always runs those from the default branch, so comments on this PR still evaluate main's line 13.
    • The repo has no workflow linter: there is no actionlint or zizmor in .github/ or .lintrunner.toml.
    • Fix: replace that sentence with a post-merge check. For example, confirm that the "Run Claude Code" step's claude_args include --effort max for an @claude ... effort=max comment, and don't for a plain @claude comment.

Recommendation

Needs Discussion

Please confirm that max effort for non-review requests is the intended change, and update the description and commit message to match. If a deeper single-pass review was the goal, this change doesn't provide it. The other items are minor.

@shoumikhin
shoumikhin force-pushed the claude-review-max-effort branch from c8a10b1 to 521a7dd Compare October 30, 2026 03:48
Copilot AI balanced review requested due to automatic review settings October 30, 2026 03:48
@shoumikhin shoumikhin changed the title Let "effort=max" in an @claude comment opt into max effort Let "effort=max" in an @claude comment or new issue opt into max effort Oct 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@shoumikhin

Copy link
Copy Markdown
Contributor Author

@claude /pr-review

@claude

claude Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Claude finished @shoumikhin's task in 14m 46s —— View job


The new condition gives the intended effort for every event type, leaving two optional points: max-effort runs stopped at the one-hour limit still lose their answer, and the keyword check could move into the shared test-infra workflow.

Detailed review

PR Review: #24275

Summary

Adds effort=max, in a comment or in the body of a new issue, as a second way to get --effort max, next to the @claude /pr-review prefix. The condition gives the intended effort for comments on issues and PRs and for new issues. Two minor points remain, and neither blocks merging.

Infrastructure

  • Max-effort runs stopped at the one-hour limit still lose their answer (.github/workflows/claude-code.yml:17-21).
    • The description accepts this risk for requests that are not reviews, whose max-effort run time has not been measured. Nothing in the change reduces it.
    • The limit is the job's timeout-minutes in test-infra's _claude-code.yml:19-22, 90, and this caller does not override it. The hour also covers checkout and the setup_script (pip install and lintrunner init, _claude-code.yml:175-181), so Claude gets less than the full hour.
    • A stopped run keeps only what Claude has already written to its comment. None of the action's always() steps touch that comment (claude-code-action/action.yml:394-459).
    • Fix: add a sentence to append_system_prompt that asks Claude, on requests that are not reviews, to keep its comment updated with its current answer. A stopped run then still leaves a partial answer. A fuller fix belongs in test-infra: greenlight-pr-review.yml:645-668 gives its Claude step its own timeout-minutes: 37 and exports soft and hard deadlines to it. Fix this →
  • The keyword check is a per-repo copy of logic the shared workflow could own (.github/workflows/claude-code.yml:17).
    • _claude-code.yml has no effort handling. The only --effort flags in test-infra are the hard-coded --effort high in greenlight-pr-review.yml:686 and vllm-torch-nightly-triage.yml:158, 326.
    • So the pytorch/pytorch opt-in that this change copies must also live in that repo's own caller. Every copy has to repeat the comment-or-issue body split that _claude-code.yml:63-69, 78-79 already documents and implements for the @claude check, and the copies can drift apart.
    • Optional follow-up: check the keyword in _claude-code.yml next to the @claude check, behind an input that each repo opts into, and remove the per-repo copies.

Recommendation

Approve

Nothing blocks merging. The first point needs one sentence in the prompt, and the second is a follow-up in test-infra.

@shoumikhin
shoumikhin force-pushed the claude-review-max-effort branch from 521a7dd to cd3dd56 Compare October 30, 2026 05:31
Copilot AI balanced review requested due to automatic review settings October 30, 2026 05:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@shoumikhin

Copy link
Copy Markdown
Contributor Author

@claude /pr-review

@claude

claude Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Claude finished @shoumikhin's task in 12m 31s —— View job


The new condition gives the intended effort for every event this workflow receives, and the only remaining points are minor and optional: one event check in it is redundant, and the description's test can't be repeated.

Detailed review

PR Review: #24275

Summary

Adds effort=max as a second way to get --effort max, next to the @claude /pr-review prefix. It works in a comment or in the body of a new issue. The condition gives the intended effort for /pr-review comments, for effort=max comments, for new issues with and without the keyword, and for plain comments on a PR or issue whose description mentions effort=max. Two minor points remain, and neither blocks merging.

Code Quality

  • The github.event_name == 'issue_comment' check does nothing (.github/workflows/claude-code.yml:15).
    • The workflow has only two triggers, issue_comment and issues (:3-7). On an issues event, github.event.comment.body is null, so contains(github.event.comment.body, 'effort=max') is already false.
    • The startsWith(github.event.comment.body, '@claude /pr-review') term in the same expression relies on this without any check. So the one expression handles the same field in two ways.
    • Fix: use plain contains(github.event.comment.body, 'effort=max'). Keep the check on the github.event.issue.body term, where the comment on :13-14 explains why it is needed. This also removes about 40 characters from the 324-character line. Fix this →

Testing

  • No one else can repeat the Python check of the condition (PR description, "Tests").
    • The script isn't included, and the description names only two of the seven sample events.
    • CONTRIBUTING.md:407-409 asks that manual tests include their steps and outputs, so a future editor can test the same code.
    • No PR check can run this condition, so these results are the only evidence a later editor of this line could reuse.
    • Fix: paste the script, or list the seven events (event_name, comment body, issue body) with the effort each one produced.

Recommendation

Approve

Nothing blocks merging. Both points are optional cleanups.

Claude runs at max effort only when a comment starts with
"@claude /pr-review". Every other request, such as a question, an
investigation or a code change, runs at the default effort, and there is
no way to ask for more.

Now a comment that contains "effort=max", or a new issue whose body
contains it, also runs at max effort, as in pytorch/pytorch. For reviews
this adds nothing new: every review request already goes through the
/pr-review skill, so "@claude review effort=max" runs the same as
"@claude /pr-review". The new effect is on requests that are not reviews.

The issue body is read only on issue events. On a comment it holds the
issue or PR description, so a description that mentions effort=max would
otherwise raise every comment there to max effort.

Max effort stays opt-in because it is slow. In recent runs on this
repository, max effort reviews took 14 to 58 minutes, against 4 to 8 at
the default. The job is stopped after one hour, when its credentials
expire, and a run stopped there posts nothing.
@shoumikhin
shoumikhin force-pushed the claude-review-max-effort branch from cd3dd56 to 8da32cd Compare October 30, 2026 06:48
Copilot AI balanced review requested due to automatic review settings October 30, 2026 06:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. release notes: none Do not include this in the release notes topic: not user facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants