Skip to content

Conversation

@pirate
Copy link
Member

@pirate pirate commented Dec 18, 2025

why

Duplicate issues take up a lot of review time for us to find and link them together.

what changed

This bot will leave comments like this on new issues when dupes are found:

image

Summary by cubic

Adds a GitHub Action that scans new issues for potential duplicates across issues and PRs, and comments with links when matches are found. This helps reduce triage time by flagging dupes at creation.

  • New Features
    • New workflow triggers on issues.opened.
    • Searches existing issues and PRs for similar titles/descriptions and symptoms.
    • Posts one comment with brief reasoning and links; stays silent if none found.
    • Uses minimal GitHub permissions (contents: read, issues: write) and scoped opencode commands.

Written for commit 8ef0fb9. Summary will update automatically on new commits.

@changeset-bot

This comment was marked as off-topic.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 18, 2025

Greptile Summary

Added a GitHub Actions workflow that automatically detects duplicate issues using OpenCode CLI with Claude Haiku 4.5, triggering on new issue creation to search for similar existing issues and post comments when duplicates are found.

Critical Issues:

  • Syntax error on line 35: unclosed quote will cause workflow to fail immediately
  • Security concern: installing OpenCode via curl | bash without verification

Minor Issues:

  • Missing newline at end of file

Confidence Score: 0/5

  • This PR cannot be merged - the workflow has a critical syntax error that will cause it to fail
  • The unclosed quote on line 35 is a blocking syntax error that will prevent the workflow from running at all. This must be fixed before the PR can be merged.
  • .github/workflows/duplicate_issue_detection.yml requires immediate attention to fix the syntax error on line 35

Important Files Changed

Filename Overview
.github/workflows/duplicate_issue_detection.yml New workflow for AI-powered duplicate issue detection with critical syntax error on line 35

Sequence Diagram

sequenceDiagram
    participant User
    participant GitHub
    participant Workflow as duplicate_issue_detection.yml
    participant OpenCode as OpenCode CLI
    participant Claude as Claude Haiku 4.5
    participant GH as GitHub CLI

    User->>GitHub: Opens new issue
    GitHub->>Workflow: Triggers workflow (issue.opened)
    Workflow->>Workflow: Checkout repository (fetch-depth: 1)
    Workflow->>OpenCode: Install via curl | bash
    OpenCode-->>Workflow: Installed
    Workflow->>OpenCode: Run with prompt + issue number
    OpenCode->>Claude: Send prompt to analyze issue
    Claude->>GH: gh issue view (new issue)
    GH-->>Claude: Issue details
    Claude->>GH: gh issue list (search existing)
    GH-->>Claude: List of issues
    Claude->>Claude: Compare for duplicates
    alt Duplicates found
        Claude->>GH: gh issue comment (add duplicate notice)
        GH->>GitHub: Post comment on issue
        GitHub-->>User: Notification with duplicates
    else No duplicates
        Claude->>OpenCode: No action needed
    end
    OpenCode-->>Workflow: Complete
    Workflow-->>GitHub: Workflow complete
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Prompt for AI agents (all 1 issue)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name=".github/workflows/duplicate_issue_detection.yml">

<violation number="1" location=".github/workflows/duplicate_issue_detection.yml:35">
P2: Mismatched quote: the string starts with `&quot;` but has a stray `&#39;` after &#39;created:&#39;. This single quote will be included literally in the prompt, which appears unintentional. Remove the single quote to fix the prompt text.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (all 1 issue)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name=".github/workflows/duplicate_issue_detection.yml">

<violation number="1" location=".github/workflows/duplicate_issue_detection.yml:40">
P2: The prompt now instructs searching PRs, but `OPENCODE_PERMISSION` only allows `gh issue*` commands. Add `&quot;gh pr*&quot;: &quot;allow&quot;` to the permissions to enable PR searching, or the AI will fail when attempting to use `gh pr` commands.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

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.

2 participants