Skip to content

Commit 145674f

Browse files
committed
Fix duplicate issue detection not performing searches
The AI inference action's default max-tokens (200) was too low, causing the model's response to be truncated before it could make search_issues tool calls. Increase max-tokens to 100000 and upgrade the model from gpt-4o to gpt-5-mini for better tool use and instruction following. Also replace the HTML comment marker (<!-- ai-duplicate-check -->) and github-actions[bot] user check with the visible text "This issue will be automatically closed as a duplicate in 3 days." for filtering duplicate comments, since the marker may be missing when posted from a personal account.
1 parent e291ccb commit 145674f

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

.github/prompts/dedupe.prompt.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ messages:
77
88
To do this, follow these steps precisely:
99
10-
1. Read issue #{{issue_number}} including its comments. Check if the issue (a) is closed, (b) does not need to be deduped (e.g. because it is broad product feedback without a specific solution, or positive feedback), or (c) already has a duplicates comment containing `<!-- ai-duplicate-check -->`. If so, do not proceed — return an empty duplicates array.
10+
1. Read issue #{{issue_number}} including its comments. Check if the issue (a) is closed, (b) does not need to be deduped (e.g. because it is broad product feedback without a specific solution, or positive feedback), or (c) already has a duplicates comment containing `This issue will be automatically closed as a duplicate in 3 days.`. If so, do not proceed — return an empty duplicates array.
1111
2. Summarize the issue: what is the core problem, symptoms, and affected features.
1212
3. Search for duplicates of this issue using diverse keywords and search approaches based on the summary. Try at least 5 different search queries to maximize coverage.
1313
4. Filter out false positives that are likely not actually duplicates of the original issue. If there are no duplicates remaining, return an empty duplicates array.
1414
5. Return the remaining duplicate issue numbers (up to 3), ranked by confidence (highest first).
15-
model: openai/gpt-4o
15+
model: openai/gpt-5-mini
1616
responseFormat: json_schema
1717
jsonSchema: |-
1818
{

.github/workflows/dedupe-issues.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
prompt-file: .github/prompts/dedupe.prompt.yml
3333
input: |
3434
issue_number: ${{ github.event.issue.number || inputs.issue_number }}
35+
max-tokens: 100000
3536
enable-github-mcp: true
3637

3738
- name: Post comment if duplicates found

scripts/auto-close-duplicates.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ async function main(): Promise<void> {
107107

108108
const comments = await getIssueComments(issue.number);
109109

110-
const botComment = comments.find(
111-
(comment) =>
112-
comment.user?.login === "github-actions[bot]" &&
113-
comment.body.includes("<!-- ai-duplicate-check -->"),
110+
const botComment = comments.find((comment) =>
111+
comment.body.includes(
112+
"This issue will be automatically closed as a duplicate in 3 days.",
113+
),
114114
);
115115

116116
if (!botComment) {

scripts/backfill-duplicate-detection.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ async function hasDuplicateDetectionComment(
2929
): Promise<boolean> {
3030
const comments = await getIssueComments(issueNumber);
3131

32-
return comments.some(
33-
(comment) =>
34-
comment.user?.login === "github-actions[bot]" &&
35-
comment.body.includes("<!-- ai-duplicate-check -->"),
32+
return comments.some((comment) =>
33+
comment.body.includes(
34+
"This issue will be automatically closed as a duplicate in 3 days.",
35+
),
3636
);
3737
}
3838

0 commit comments

Comments
 (0)