Repository navigation
Description
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.tsapps/web/src/lib/query/search-tuning.tsapps/web/src/features/issues/quick-create.tsxpackages/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.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsBacklog
Activity
imshashank commentedon Aug 8, 2026
Sequencing note, so this does not collide with #216.
This issue is the trigram version:
issue.titleandissue.descriptionalready carry GIN trigram indexes, andapps/web/src/lib/query/issue-search.tsalready 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.
imshashank commentedon Sep 6, 2026
#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.
imshashank commentedon Sep 6, 2026
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.