Problem
When an agentic triage workflow closes an issue as a duplicate, the close-issue safe output can only:
- set
state-reason: duplicate (the "closed this as duplicate" event), and
- post its
body as a plain comment.
There's no way to tell it which issue is the canonical original, so GitHub's native "marked this as a duplicate of #X" relationship is never created. The linkage survives only as free text in a comment.
Current behavior (from a real triage run in github/issues)
Our triage agent closed a duplicate and the timeline showed:
- a comment:
Duplicate of #22853
- a separate event:
github-actions closed this as duplicate
No native duplicate relationship — just a comment plus a generic duplicate close.
Root cause
The close_issue handler (actions/setup/js/close_issue.cjs) does roughly:
await github.rest.issues.update({ ..., state: "closed", state_reason: "duplicate" });
// and, if a body is present:
await github.rest.issues.createComment({ ..., body });
issues.update records that an issue is a duplicate but not of what. There is no duplicate-of / canonical-issue parameter, and no call to the native duplicate mutation.
Proposed
Add an optional duplicate-of parameter (canonical issue number or URL) to the close-issue safe output. When set together with state-reason: duplicate, create the native duplicate relationship (via the duplicate GraphQL mutation) so it produces a marked_as_duplicate timeline event linking the canonical issue, instead of (or in addition to) posting a comment.
Benefit
- Proper native duplicate graph (dedup, related-issues UI, analytics).
- Cleaner timeline — no separate "Duplicate of #X" comment noise.
- Matches how a human marks a duplicate in the UI.
Context
The github/issues repo uses an agentic triage workflow that closes high-confidence duplicates. Native duplicate marking would let it link duplicates properly rather than leaving a text comment.
Problem
When an agentic triage workflow closes an issue as a duplicate, the
close-issuesafe output can only:state-reason: duplicate(the "closed this as duplicate" event), andbodyas a plain comment.There's no way to tell it which issue is the canonical original, so GitHub's native "marked this as a duplicate of #X" relationship is never created. The linkage survives only as free text in a comment.
Current behavior (from a real triage run in
github/issues)Our triage agent closed a duplicate and the timeline showed:
Duplicate of #22853github-actions closed this as duplicateNo native duplicate relationship — just a comment plus a generic duplicate close.
Root cause
The
close_issuehandler (actions/setup/js/close_issue.cjs) does roughly:issues.updaterecords that an issue is a duplicate but not of what. There is noduplicate-of/ canonical-issue parameter, and no call to the native duplicate mutation.Proposed
Add an optional
duplicate-ofparameter (canonical issue number or URL) to theclose-issuesafe output. When set together withstate-reason: duplicate, create the native duplicate relationship (via the duplicate GraphQL mutation) so it produces amarked_as_duplicatetimeline event linking the canonical issue, instead of (or in addition to) posting a comment.Benefit
Context
The
github/issuesrepo uses an agentic triage workflow that closes high-confidence duplicates. Native duplicate marking would let it link duplicates properly rather than leaving a text comment.