You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix triage agent creating duplicate PRs for the same issue (#15787)
Add mandatory Step 4a: before implementing a fix, search for existing
open PRs (by branch name, title/body reference, and cache-memory).
If one exists, skip instead of creating another.
After creating a PR, add State: In-PR label to the issue so future
scheduled runs skip it (the skip list already includes this label).
Also tighten backlog selection to exclude issues with State: In-PR.
Fixes the pattern where #15643 got 4 separate fix PRs because the
agent kept picking it up on scheduled runs without checking for
existing work.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: .github/workflows/issue-repro-triage.md
+23-2Lines changed: 23 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,7 +107,7 @@ Your goal: **drive open issues to zero.** Process the backlog systematically:
107
107
2.**New issues from external contributors**: Check issues opened in the last 24 hours that have NOT been triaged yet (no agent comment, no triage labels). These were skipped on creation because the author lacked write permission. Triage them now — they deserve the same treatment as maintainer-filed issues.
108
108
3.**Backlog**: Work through open bug issues. Process **up to 3 issues** per run. Selection priority:
109
109
a. Issues with `Needs: Triage :mag:` label (untriaged, newest first)
110
-
b. Oldest open bug issues that have repro steps but no linked PR
110
+
b. Oldest open bug issues that have repro steps but no linked PR and no `State: In-PR` label
111
111
c. Issues without repro steps that you can investigate from the description alone
If the bug is reproducible and the fix appears scoped (not requiring architectural decisions):
162
162
163
+
#### Step 4a: Check for existing PRs (MANDATORY)
164
+
165
+
Before writing any code, search for existing open PRs that already address this issue:
166
+
167
+
1. Search for open PRs with branch names matching `fix/issue-<number>` (e.g. `fix/issue-15643`)
168
+
2. Search for open PRs whose title or body references this issue number
169
+
3. Check the `auto-fix-prs` cache-memory key for previously created PRs for this issue
170
+
171
+
**If an existing open PR is found:**
172
+
- Do NOT create a new PR. Instead, add a comment on the issue noting the existing PR (if not already noted).
173
+
- Add label `State: In-PR` to the issue if not already present.
174
+
- If the existing PR has review feedback that hasn't been addressed, consider iterating on it instead of creating a new one — but only if you can push to the branch.
175
+
-`noop` with message: "Existing PR #NNN already addresses this issue."
176
+
177
+
**If all existing PRs for this issue are closed** (not merged), evaluate whether the previous approach was wrong or just abandoned. If wrong, try a different approach. If abandoned, consider reopening rather than creating yet another PR.
178
+
179
+
#### Step 4b: Implement the fix
180
+
163
181
1.**Read AGENTS.md** for repo conventions
164
182
2.**Understand the root cause** by reading the relevant source code
165
183
3.**Implement a fix** on a new branch `fix/issue-<number>`
@@ -174,7 +192,10 @@ The PR description should include:
174
192
- What the fix does
175
193
- Test that verifies the fix
176
194
177
-
After creating the PR, **register it in cache-memory** so the PR Iteration workflow knows to follow up:
195
+
After creating the PR:
196
+
197
+
1.**Add label `State: In-PR`** to the issue so future triage runs skip it.
198
+
2.**Register it in cache-memory** so the PR Iteration workflow knows to follow up:
0 commit comments