Skip to content

fix: add explicit sort parameters to auto-close-duplicates query#52417

Open
sakal-s wants to merge 1 commit intoanthropics:mainfrom
sakal-s:fix/auto-close-duplicates-sort
Open

fix: add explicit sort parameters to auto-close-duplicates query#52417
sakal-s wants to merge 1 commit intoanthropics:mainfrom
sakal-s:fix/auto-close-duplicates-sort

Conversation

@sakal-s
Copy link
Copy Markdown

@sakal-s sakal-s commented Apr 23, 2026

Summary

  • Add explicit sort=created&direction=asc to the issues API query
  • Without this, the default sort (created DESC) returns newest issues first, and the script filters for issues older than 3 days — wasting API calls on recent issues that all get filtered out
  • With the 20-page safety limit (2000 issues), older eligible issues may never be reached in high-volume repos

Test plan

  • Verify the script still correctly identifies and closes duplicate issues
  • Verify older issues are processed first, reducing wasted API calls

Fixes #52407

🤖 Generated with Claude Code

…cates

The issues endpoint is called without sort parameters, defaulting to
sort=created&direction=desc (newest first). Since the script filters
for issues created more than 3 days ago, the first pages are full of
recent issues that all get filtered out, wasting API calls. With the
20-page safety limit, older issues may never be reached in repos with
high issue volume.

Sort by created ascending so the oldest issues (most likely to pass
the 3-day filter) appear on the first pages.

Fixes anthropics#52407

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Sort/filter mismatch in auto-close-duplicates script causes missed issues

2 participants