fix: pr-bug-scan validated finding from #1917 (#1961)

Co-authored-by: orca-bug-scan-bot <orca-bug-scan-bot@stably.ai>
This commit is contained in:
buf0-bot[bot] 2026-05-15 17:01:11 -07:00 committed by GitHub
parent 08c2463b6f
commit 014cc1e4b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -100,6 +100,12 @@ export async function searchIssues(
}
})
)
// Why: searchIssues returns Linear's relevance ranking. Re-sorting by
// updatedAt would discard relevance order for single-workspace results,
// diverging from Linear's web UI and pre-PR behavior.
if (entries.length === 1) {
return results.flat().slice(0, limit)
}
return sortAndLimitIssues(results.flat(), limit)
}