fix(ten-334): require exact-match when finding TEN issue by GitHub ref#15
Open
marvin-tensorleap wants to merge 1 commit into
Open
fix(ten-334): require exact-match when finding TEN issue by GitHub ref#15marvin-tensorleap wants to merge 1 commit into
marvin-tensorleap wants to merge 1 commit into
Conversation
lavie
reviewed
May 6, 2026
| githubRef: string, | ||
| ): Promise<{ id: string; identifier: string } | null> { | ||
| const results = await ctx.issues.list({ companyId, q: githubRef, limit: 5 }); | ||
| const results = await ctx.issues.list({ companyId, q: githubRef, limit: 10 }); |
Member
There was a problem hiding this comment.
Why 10? If the search tokenizes the phrase won't there be potentially hundreds/thousands of matches?
Collaborator
Author
There was a problem hiding this comment.
Good catch. The concern is exactly right — the text search may tokenize into individual tokens and return many unrelated matches. Capping at 10 risks missing the correct issue if it falls outside the top results.
Fixed in 35807eb: removed the limit parameter from findTenIssue so all candidates are returned for the exact-string post-filter. Also reverted the pnpm-lock.yaml modification that the nightly auto-commit introduced (CI owns lockfile updates per project policy).
Text search tokenizes the query (e.g. "tensorleap/concierge#413") and can return false-positive matches. Replace the first-result heuristic with an exact-string filter: fetch all candidates (no limit), then accept only issues whose title or description literally contains the full ref. Co-Authored-By: Paperclip <noreply@paperclip.ing>
3656ea0 to
05f7e2a
Compare
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After deploying the webhook dispatcher plugin (merged in #13), all events were routing to the same TEN issue (TEN-310) regardless of which GitHub ref was in the event. Root cause: the
issues.listtext search tokenizes the query string (e.g.tensorleap/concierge#413) and returns false-positive matches on issues that contain the wordtensorleapbroadly.Fix
After fetching up to 10 search candidates, filter client-side: only accept issues whose
titleordescriptionliterally contains the full GitHub ref string (e.g.tensorleap/concierge#413).Test
tensorleap/concierge#999→ correctly creates triage issue (not matched to TEN-310)🤖 Generated with Claude Code