Skip to content

Auto PR Triage: switch from shadow to live mode - #199507

Closed
soulitzer wants to merge 1 commit into
gh/soulitzer/483/basefrom
gh/soulitzer/483/head
Closed

soulitzer wants to merge 1 commit into
gh/soulitzer/483/basefrom
gh/soulitzer/483/head

Conversation

@soulitzer

@soulitzer soulitzer commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

This sets AUTO_PR_TRIAGE_MODE to live, which turns on the write-capable apply
job and the error-reporting job. In live mode the bot can only request
reviewers and add labels (triaged, bot-triaged, missing actionable issue,
or bot-triage-error). It has no action that closes a PR or posts a comment.
To go back to shadow, set the value back to shadow.

This is stacked on #199428, which fixes the problems found in the first day of
shadow runs: eligible PRs dropped by the concurrency group, too few
structured-output retries, and evidence-excerpt rejections. Live mode should
land only after that change.

In that first day (2026-10-02), shadow mode analyzed 45 PRs. The planned
decisions were triage 12, missing_actionable_issue 11, kept_open 7,
routed_untriaged 3, and incomplete 12. All 12 incomplete runs were LLM or
validation failures that #199428 addresses. In live mode, incomplete runs get
bot-triage-error and fall back to human triage.

The labels the workflow needs (open source, actionable, triaged,
bot-triaged, bot-triage-error, missing actionable issue) already exist on
pytorch/pytorch, and the bedrock environment is already in use by the shadow
runs.

Test Plan:

actionlint .github/workflows/auto-pr-triage.yml
gh api repos/pytorch/pytorch/labels/<name>   # for each label above

The first live runs after landing should be watched to confirm that the apply
job requests the planned reviewers and adds the planned labels.

This PR was authored with an AI assistant (Claude Code).

[ghstack-poisoned]
@pytorch-bot pytorch-bot Bot added the topic: not user facing topic category label Oct 2, 2026
@pytorch-bot

pytorch-bot Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

⏳ No Failures, 14 Pending

As of commit f409937 with merge base 7da85ca (image):
💚 Looks good so far! There are no failures yet. 💚

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

@albanD
albanD marked this pull request as ready for review October 2, 2026 15:40
@albanD
albanD requested a review from a team as a code owner October 2, 2026 15:40
@soulitzer

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge -f "lint passed on bottom PR, and this one is trivial"

@albanD albanD left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's do this!

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

pytorchmergebot pushed a commit that referenced this pull request Oct 2, 2026
)

Until now, a PR could be triaged by the label only once. The admission step
counted the PR's `open source` labeled events and admitted a labeled event
only when the count was exactly 1, so removing and re-adding the label was
skipped as a repeated event. The only way to reevaluate a PR was to rerun all
jobs of its original run by hand.

Now every `open source` labeled event is admitted. Adding a label needs triage
permission, so a re-add is a deliberate request to triage, which matches the
existing rule that the label, not the ready event, is the authorization. A PR
that already has an outcome label (`triaged`, `bot-triaged`, or
`bot-triage-error`) is still a no-op: intake marks it handled, so the run skips
the LLM and plans nothing. To reevaluate a PR, remove its outcome labels and
remove and re-add `open source`. That run is a first attempt, so it may mark
the PR as missing an actionable issue again, unlike a manual rerun.

The ready-for-review rule is unchanged: it admits the first ready event after
the latest `open source` label, so a re-add resets it. A labeled event no
longer depends on the timeline history, so it is admitted even when that
history is truncated; the truncation check now only applies to ready events.

Test Plan:

```
cd scripts/auto_pr_triage && python -m unittest discover -p 'test_*.py'
actionlint .github/workflows/auto-pr-triage.yml
```

test_workflow_admits_label_events_and_first_ready_event runs the admission
script against fake timelines; it now expects a second `open source` label to
be admitted, and a labeled event to be admitted with truncated history.

This PR was authored with an AI assistant (Claude Code).
Pull Request resolved: #199508
Approved by: https://github.com/janeyx99
ghstack dependencies: #199428, #199507
cyyever pushed a commit to BakeLab/pytorch that referenced this pull request Oct 11, 2026
This sets AUTO_PR_TRIAGE_MODE to live, which turns on the write-capable apply
job and the error-reporting job. In live mode the bot can only request
reviewers and add labels (`triaged`, `bot-triaged`, `missing actionable issue`,
or `bot-triage-error`). It has no action that closes a PR or posts a comment.
To go back to shadow, set the value back to `shadow`.

This is stacked on pytorch#199428, which fixes the problems found in the first day of
shadow runs: eligible PRs dropped by the concurrency group, too few
structured-output retries, and evidence-excerpt rejections. Live mode should
land only after that change.

In that first day (2026-10-02), shadow mode analyzed 45 PRs. The planned
decisions were triage 12, missing_actionable_issue 11, kept_open 7,
routed_untriaged 3, and incomplete 12. All 12 incomplete runs were LLM or
validation failures that pytorch#199428 addresses. In live mode, incomplete runs get
`bot-triage-error` and fall back to human triage.

The labels the workflow needs (`open source`, `actionable`, `triaged`,
`bot-triaged`, `bot-triage-error`, `missing actionable issue`) already exist on
pytorch/pytorch, and the `bedrock` environment is already in use by the shadow
runs.

Test Plan:

```
actionlint .github/workflows/auto-pr-triage.yml
gh api repos/pytorch/pytorch/labels/<name>   # for each label above
```

The first live runs after landing should be watched to confirm that the apply
job requests the planned reviewers and adds the planned labels.

This PR was authored with an AI assistant (Claude Code).
Pull Request resolved: pytorch#199507
Approved by: https://github.com/janeyx99, https://github.com/albanD
ghstack dependencies: pytorch#199428
cyyever pushed a commit to BakeLab/pytorch that referenced this pull request Oct 11, 2026
…rch#199508)

Until now, a PR could be triaged by the label only once. The admission step
counted the PR's `open source` labeled events and admitted a labeled event
only when the count was exactly 1, so removing and re-adding the label was
skipped as a repeated event. The only way to reevaluate a PR was to rerun all
jobs of its original run by hand.

Now every `open source` labeled event is admitted. Adding a label needs triage
permission, so a re-add is a deliberate request to triage, which matches the
existing rule that the label, not the ready event, is the authorization. A PR
that already has an outcome label (`triaged`, `bot-triaged`, or
`bot-triage-error`) is still a no-op: intake marks it handled, so the run skips
the LLM and plans nothing. To reevaluate a PR, remove its outcome labels and
remove and re-add `open source`. That run is a first attempt, so it may mark
the PR as missing an actionable issue again, unlike a manual rerun.

The ready-for-review rule is unchanged: it admits the first ready event after
the latest `open source` label, so a re-add resets it. A labeled event no
longer depends on the timeline history, so it is admitted even when that
history is truncated; the truncation check now only applies to ready events.

Test Plan:

```
cd scripts/auto_pr_triage && python -m unittest discover -p 'test_*.py'
actionlint .github/workflows/auto-pr-triage.yml
```

test_workflow_admits_label_events_and_first_ready_event runs the admission
script against fake timelines; it now expects a second `open source` label to
be admitted, and a labeled event to be admitted with truncated history.

This PR was authored with an AI assistant (Claude Code).
Pull Request resolved: pytorch#199508
Approved by: https://github.com/janeyx99
ghstack dependencies: pytorch#199428, pytorch#199507
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants