bug(auto-close): closeIssueAsDuplicate strips all triage labels (bug, platform:*, area:*) via PATCH
What's Wrong?
scripts/auto-close-duplicates.ts calls the GitHub Issues PATCH endpoint with:
\\\json\
{ "state": "closed", "state_reason": "duplicate", "labels": ["duplicate"] }
\\
The GitHub API treats the labels field as a replacement, not an append. Every issue auto-closed as a duplicate loses all its existing triage labels (bug, has repro, platform:macos, area:sandbox, etc.), retaining only duplicate.
What Should Happen?
The script should fetch the issue's current labels first, merge duplicate into the list, and only then PATCH — so triage metadata is preserved.
Reproduction
Run auto-close-duplicates.ts against any issue that has labels beyond duplicate. After closing, only duplicate remains.
Impact
Every daily run of the auto-close-duplicates workflow silently degrades issue data quality for all auto-closed duplicates.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗