From 6f0011ee2ab202760e2f62d4110a51156c193b8d Mon Sep 17 00:00:00 2001 From: Ryan Crabbe Date: Thu, 19 Feb 2026 13:29:35 -0800 Subject: [PATCH 1/2] perf: upgrade duplicate issue detection to AI-powered search via opencode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the text-similarity based wow-actions/potential-duplicates with opencode CLI + Claude Sonnet for semantic duplicate detection. The LLM reads the full issue body and searches existing issues by keywords, error messages, providers, and components — not just title similarity. Requires ANTHROPIC_API_KEY repo secret. --- .github/workflows/check_duplicate_issues.yml | 59 ++++++++++++++------ 1 file changed, 41 insertions(+), 18 deletions(-) diff --git a/.github/workflows/check_duplicate_issues.yml b/.github/workflows/check_duplicate_issues.yml index 14d6964fcdb..18802cd1fff 100644 --- a/.github/workflows/check_duplicate_issues.yml +++ b/.github/workflows/check_duplicate_issues.yml @@ -2,28 +2,51 @@ name: Check Duplicate Issues on: issues: - types: [opened, edited] + types: [opened] jobs: - check-duplicate: + check-duplicates: + if: github.event.action == 'opened' runs-on: ubuntu-latest permissions: - issues: write contents: read + issues: write steps: - - name: Check for potential duplicates - uses: wow-actions/potential-duplicates@v1 - with: + - name: Install opencode + run: curl -fsSL https://opencode.ai/install | bash + + - name: Check duplicates + env: + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - label: potential-duplicate - threshold: 0.6 - reaction: eyes - comment: | - **⚠️ Potential duplicate detected** - - This issue appears similar to existing issue(s): - {{#issues}} - - [#{{number}}]({{html_url}}) - {{title}} ({{accuracy}}% similar) - {{/issues}} - - Please review the linked issue(s) to see if they address your concern. If this is not a duplicate, please provide additional context to help us understand the difference. + OPENCODE_PERMISSION: | + { + "bash": { + "*": "deny", + "gh issue*": "allow" + }, + "webfetch": "deny" + } + run: | + opencode run -m anthropic/claude-sonnet-4-6 "A new issue has been created: + + Issue number: ${{ github.event.issue.number }} + + Lookup this issue with gh issue view ${{ github.event.issue.number }}. + + Search through existing issues (excluding #${{ github.event.issue.number }}) to find potential duplicates. + + Use gh issue list with relevant search terms from the new issue's title and description. Try multiple keyword combinations to search broadly. Check both open and recently closed issues. + + Consider: + 1. Similar titles or descriptions + 2. Same error messages or symptoms + 3. Related functionality or components + 4. Similar feature requests + + If you find potential duplicates, post a SINGLE comment on issue #${{ github.event.issue.number }} using this format: + + This issue might be a duplicate of existing issues. Please check: + - #[issue_number]: [brief description of similarity] + + If you find NO duplicates, do NOT post any comment. Stay silent." From dc13378505e120f8b6fbea8da7eb906677b8ded3 Mon Sep 17 00:00:00 2001 From: Ryan Crabbe Date: Thu, 19 Feb 2026 17:51:44 -0800 Subject: [PATCH 2/2] feat: add AI-powered duplicate PR detection via opencode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Same approach as the duplicate issue detector — uses opencode run with gh pr commands to find potentially duplicate open PRs when external contributors open new PRs. Skips core team and bots. --- .github/workflows/check_duplicate_prs.yml | 58 +++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/check_duplicate_prs.yml diff --git a/.github/workflows/check_duplicate_prs.yml b/.github/workflows/check_duplicate_prs.yml new file mode 100644 index 00000000000..be697fa5921 --- /dev/null +++ b/.github/workflows/check_duplicate_prs.yml @@ -0,0 +1,58 @@ +name: Check Duplicate PRs + +on: + pull_request_target: + types: [opened] + +jobs: + check-duplicates: + if: | + github.event.pull_request.user.login != 'ishaan-jaff' && + github.event.pull_request.user.login != 'krrishdholakia' && + github.event.pull_request.user.login != 'actions-user' && + !endsWith(github.event.pull_request.user.login, '[bot]') + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - name: Install opencode + run: curl -fsSL https://opencode.ai/install | bash + + - name: Check duplicates + env: + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + OPENCODE_PERMISSION: | + { + "bash": { + "*": "deny", + "gh pr*": "allow" + }, + "webfetch": "deny" + } + run: | + opencode run -m anthropic/claude-sonnet-4-6 "A new PR has been opened: + + PR number: ${{ github.event.pull_request.number }} + + Lookup this PR with gh pr view ${{ github.event.pull_request.number }}. + + Search through existing open PRs (excluding #${{ github.event.pull_request.number }}) to find potential duplicates. + + Use gh pr list with relevant search terms from the new PR's title and description. Try multiple keyword combinations to search broadly. Check both open and recently closed PRs. + + Consider: + 1. Similar titles or descriptions + 2. Same bug fix or feature being implemented + 3. Related functionality or components + 4. Overlapping code changes (same files or areas) + + If you find potential duplicates, post a SINGLE comment on PR #${{ github.event.pull_request.number }} using gh pr comment with this format: + + _This comment was generated by an LLM and may be inaccurate._ + + This PR might be a duplicate of existing PRs. Please check: + - #[pr_number]: [brief description of similarity] + + If you find NO duplicates, do NOT post any comment. Stay silent."