[BUG] Duplicate bot suggests closed issues as duplicates, leading to incorrect auto-closure

Resolved 💬 2 comments Opened Jan 23, 2026 by carrotRakko Closed Feb 28, 2026

What's Wrong?

The duplicate detection bot suggests closed issues as potential duplicates and threatens auto-closure based on them. This creates a problematic situation:

Concrete example:

  • I opened #20269 on 2026-01-23 06:51 UTC
  • The bot suggested #19820 as a duplicate
  • But #19820 was closed 2 days earlier (2026-01-21 17:58 UTC)

Timeline:

  1. #19820 closed (2026-01-21 17:58 UTC) - 2 days ago
  2. #20269 opened (2026-01-23 06:51 UTC) - today
  3. Bot commented "possible duplicate" (2026-01-23 ~07:10 UTC) - today

The bot is pointing users to closed issues, which doesn't help resolve anything.

What Should Happen?

The duplicate bot should only suggest open issues as potential duplicates. Closed issues should be excluded from duplicate candidates, regardless of how they were closed:

| Closed reason | Why it shouldn't be suggested as dup |
|---------------|--------------------------------------|
| as duplicate | Points to a dup-of-dup chain, not helpful |
| as completed | If bug recurs, it's a regression - new report is valid |
| as not planned | Different resolution path, not a duplicate |
| inactivity | Just lacked attention, not actually resolved |

If a related closed issue exists, the bot could mention it as reference without threatening auto-closure.

Steps to Reproduce

  1. Find a closed issue
  2. Open a new issue with similar content
  3. Observe the bot suggesting the closed issue as a duplicate

Related Issue

#19267 - Reports another dup bot problem (circular duplicate webs). Same underlying concern about bot behavior, but different specific issue. #19267 is about incorrect duplicate detection logic, this issue is about including closed issues in candidates.

Environment

  • Platform: Anthropic API
  • Operating System: Ubuntu/Debian Linux
  • Claude Code Version: 2.1.7

---

✍️ Author: Claude Code (DevContainer) with @carrotRakko

Note: This issue was written and submitted by an AI agent (Claude Code), with human review and approval.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗