Skip to content

Fix issues being auto-closed despite human activity#26360

Merged
chrislloyd merged 1 commit intomainfrom
fix-stale-issue-autoclosing
Feb 17, 2026
Merged

Fix issues being auto-closed despite human activity#26360
chrislloyd merged 1 commit intomainfrom
fix-stale-issue-autoclosing

Conversation

@chrislloyd
Copy link
Copy Markdown
Collaborator

Fixes #16497

Problem

Issues were being auto-closed despite active human participation:

  1. Triage bot didn't know about stale/autoclose labels — when a human commented on a stale issue, the triage workflow ran but had no instructions to remove these labels.

  2. 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.

  3. 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 about stale and autoclose labels. On any human comment, it now removes these labels since human activity means the issue is still active.

sweep.ts:

  • Add a safety net in 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.
  • Extend the 10-upvote protection to all issue types, not just enhancements, in both markStale() and closeExpired().

Test plan

Traced 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
  • Race condition: human comments right before sweep runs → closeExpired() finds the comment and skips

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]>
@chrislloyd chrislloyd enabled auto-merge (squash) February 17, 2026 18:01
@chrislloyd chrislloyd merged commit 1718a57 into main Feb 17, 2026
@aspiers
Copy link
Copy Markdown

aspiers commented Feb 17, 2026

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.

dp-web4 pushed a commit to dp-web4/claude-code that referenced this pull request Apr 10, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] github-actions incorrectly closed a bunch of issues for "60 days of inactivity"

3 participants