Skip to content

Duplicate issue detection at creation time #212

Closed

Description

@imshashank

Orbit can record that two issues are duplicates. issue_relation in packages/db/src/schema/work.ts exists for exactly this class of link. What Orbit cannot do is notice.

So duplicates get filed, sit in the backlog, get assigned to two people, and get found weeks later by accident.

What to build

Duplicate detection at the moment of creation, and a way to find existing ones afterwards.

At creation. As somebody types a title in the new issue dialog, show up to three or four existing issues that look similar, with their state, so it is obvious whether the match is already fixed. Not a modal, not a blocking step, just a quiet list under the field with an option to open one instead of creating a new one.

After the fact. A way to find likely duplicates across a backlog, so the mess that already exists can be cleaned up. This can be a simple report rather than a full surface.

Merging. When two issues are confirmed duplicates, one closes as a duplicate of the other, comments and subscribers move or are linked, and anyone watching the closed one is told where it went. Check whether issue_relation already has a duplicate relation type before adding one.

How to match

Start simple. The infrastructure is already there:

issue has GIN trigram indexes on both title and description, plus a search path in apps/web/src/lib/query/issue-search.ts and tuning in search-tuning.ts. Trigram similarity on the title, filtered to the same team and to issues that are not archived, gets most of the value for almost no new machinery.

Do that first. It is a small change, it can ship in days, and it will catch the common case, which is two people filing the same bug with nearly the same wording.

Do not start with embeddings. Semantic similarity would catch more, and it brings a model dependency, an embedding store, a backfill, and an ongoing cost, none of which fit a project that has to be runnable by somebody with Docker and no API keys. If it is worth doing later it should be optional and behind configuration, and it should be its own issue with its own discussion. Say so on this thread if you disagree, but the trigram version should exist first either way.

Details

  • Permissions. Suggestions must only include issues the person may read. Filtering after the query is not enough if the count leaks
  • Latency. This runs on every keystroke in the title field. Debounce it, cap it, and make sure a slow suggestion query never blocks issue creation
  • False positives are expensive. A suggestion list that is usually wrong gets ignored within a week and then it is just latency. Tune for precision over recall, and put the threshold somewhere it can be adjusted

Files

  • apps/web/src/lib/query/issue-search.ts
  • apps/web/src/lib/query/search-tuning.ts
  • apps/web/src/features/issues/quick-create.tsx
  • packages/core/src/work/
  • packages/db/src/schema/work.ts

Good first substantial issue

The trigram version is well scoped, the indexes already exist, and the surface is one component.

Activity

  1. added this to the Planning parity milestone on Aug 8, 2026
  2. added
    enhancement
    help wanted
    p2 medium
    area: issues
    area: search
    on Aug 8, 2026
  3. moved this to Backlog in Orbit roadmapon Aug 8, 2026
  4. added
    size: medium
    points: 3
    on Aug 8, 2026
  5. imshashank commented on Aug 8, 2026

    @imshashank
    ContributorAuthor

    Sequencing note, so this does not collide with #216.

    This issue is the trigram version: issue.title and issue.description already carry GIN trigram indexes, and apps/web/src/lib/query/issue-search.ts already has the query path, so this is a small change that catches the common case of two people filing the same bug with nearly the same wording.

    #216 is the semantic layer on top, and it explicitly says to build this one first. Do not build both at once, and do not start with embeddings here.

  6. imshashank commented on Sep 6, 2026

    @imshashank
    ContributorAuthor

    #379 is the trigram version and is close to merging. When it lands this closes, and the after-the-fact report plus merging as duplicates become #418.

  7. imshashank commented on Sep 6, 2026

    @imshashank
    ContributorAuthor

    The trigram version landed in #379: as you type a title in the new issue dialog, up to four similar open issues on the same team appear under the field with their state, and the query is scoped to what the caller may read. The after-the-fact report and merging as duplicates continue in #418, which is unblocked now. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: issuesarea: searchenhancementhelp wantedp2 mediumpoints: 3size: medium

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions