Fix issues being auto-closed despite human activity#26360
Conversation
The sweep script was closing issues based solely on when a lifecycle label was applied, ignoring any human comments posted after the label. This caused active issues (like #11792) to be closed even when users responded to the stale warning. Three changes: 1. Teach the triage bot about `stale` and `autoclose` labels so it removes them when a human comments on the issue. 2. Add a safety net in `closeExpired()` that checks for non-bot comments posted after the lifecycle label was applied — if any exist, skip closing. 3. Extend the 10-upvote protection (which previously only applied to enhancements) to all issue types, in both `markStale()` and `closeExpired()`. Fixes #16497 ## Test plan Trace through scenarios manually: - Issue with stale label + human comment after → triage removes label; sweep skips even if triage hasn't run yet (safety net) - Issue with stale label + no human comment → closes as before - Issue with 10+ upvotes of any type → never marked stale or closed Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
This only partially fixes the problem; there shouldn't be ANY auto-closing except perhaps for duplicates. My personal recommendation is that it is usually more productive to leave issues open until there is a clear resolution (e.g. a fix, or a decision such as "we're not going to implement this"). When issues or feature requests are marked as closed without resolution, then people are more likely to miss them, resulting in duplicate reports. And people searching for ways to contribute are more likely to miss them too. This results in fragmentation of discussion and votes. Here's someone else's blog post on the same topic. However I understand it is annoying to have open issues going nowhere. IMHO one solution for this is to label short-lived and long-lived issues differently to distinguish them. Another is assigning issues to different milestones. This makes it clear to users which issues are likely to be fixed sooner rather than later. |
The sweep script was closing issues based solely on when a lifecycle label was applied, ignoring any human comments posted after the label. This caused active issues (like anthropics#11792) to be closed even when users responded to the stale warning. Three changes: 1. Teach the triage bot about `stale` and `autoclose` labels so it removes them when a human comments on the issue. 2. Add a safety net in `closeExpired()` that checks for non-bot comments posted after the lifecycle label was applied — if any exist, skip closing. 3. Extend the 10-upvote protection (which previously only applied to enhancements) to all issue types, in both `markStale()` and `closeExpired()`. Fixes anthropics#16497 ## Test plan Trace through scenarios manually: - Issue with stale label + human comment after → triage removes label; sweep skips even if triage hasn't run yet (safety net) - Issue with stale label + no human comment → closes as before - Issue with 10+ upvotes of any type → never marked stale or closed Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
Fixes #16497
Problem
Issues were being auto-closed despite active human participation:
Triage bot didn't know about
stale/autocloselabels — when a human commented on a stale issue, the triage workflow ran but had no instructions to remove these labels.closeExpired()in sweep.ts ignored human activity — it only checked when the lifecycle label was applied and whether enough time had passed. Human comments after the label were irrelevant.Upvote protection only applied to enhancements — popular bug reports with 10+ upvotes could still be auto-closed.
Example: #11792 had three human comments after the stale warning but was still auto-closed.
Changes
claude-issue-triage.yml: Teach the triage bot aboutstaleandautocloselabels. On any human comment, it now removes these labels since human activity means the issue is still active.sweep.ts:closeExpired()— before closing, check for non-bot comments posted after the lifecycle label was applied. If any exist, skip closing. This catches race conditions where the sweep runs before the triage bot processes a comment.markStale()andcloseExpired().Test plan
Traced through scenarios manually:
stalelabel + human comment after → triage removes label; sweep skips even if triage hasn't run yet (safety net)stalelabel + no human comment → closes as beforecloseExpired()finds the comment and skips