Repository navigation
Rank thread search by title match, then recency - #5003
Merged
Merged
Conversation
Searching "moss plugins" ranked three message-only threads above the thread titled "Moss plugins", because threads were ordered by the best bm25 score of any segment. Threads whose title contains every query word now come first, then the rest by most recent activity. Without bm25 the query no longer scores every matching segment twice. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
A titled thread's fallback text (taken from its first prompt) could match the query and rank it as a title match. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 6, 2026
brsbl
added a commit
that referenced
this pull request
Oct 6, 2026
## Human comments ## What was wrong Server thread search kept `_` inside a query word, so `foo_bar` became the full-text phrase "foo" then "bar". ⌘K's title check, and the search index itself, treat `_` as a word break. As a result, ⌘K could move a thread into its title-match section when the server had ranked it as a message-only match, and a title with both words apart, like "Search the thread list" for `thread_search`, wasn't found at all. ## What changed - Thread search now splits queries on `_` the same way it splits on spaces and hyphens. - `thread_search` finds threads containing both "thread" and "search", ranking titles with both words first. - Highlights cover each word separately. - Underscored queries no longer require the words to be next to each other, matching how hyphenated queries already behave. ## How you verified - Remote CI: passed on 44e1c7a, including the new db test. Two unrelated Windows server timeouts passed on rerun. [Run](https://github.com/get-bb/bb/actions/runs/37511624334) - New db test: `thread_search` ranks "Search the thread list" first and highlights both words. Today's code doesn't find that title at all. - New ⌘K unit case: `thread_search` treats "Search the thread list" as a title match, the same as the server. Follows #5003 and #4962. BB-Thread: [⌘K improvements](https://brsbl.getbb.app/projects/proj_khiw2za95v/threads/thr_tm8utsbqpb) 🤖 Generated with [Claude Code](https://claude.com/claude-code) > AGENT GENERATED Co-authored-by: Claude Opus 5.5 <[email protected]>
brsbl
added a commit
that referenced
this pull request
Oct 6, 2026
## Human comments ## What was wrong The search ranking evals behind #5003 ran only once, by hand, against a copy of a real workspace. Nothing kept checking them, so a later change could quietly bring back the old ordering. ## What changed - A new db test runs those evals against a built-in synthetic workspace. - The workspace uses the eval titles plus newer distractor threads whose messages repeat the query words. - For each of 14 queries, the test checks the expected title matches in order and that the rest follow by most recent activity. - It also checks the results are exactly the threads containing every word, and that every highlight covers a query word. - New cases cover accents ("cafe" → "Café sync"), a hyphenated query whose words appear in separate messages ("plugin-sdk"), a fallback-only title, and a titled thread's fallback. - The timing cases are left out because they would be flaky in CI. ## How you verified - Remote CI: passed on ca442c6, including all 14 ranking cases. One unrelated Windows provider-parity flake passed on rerun. [Run](https://github.com/get-bb/bb/actions/runs/37506173950) - Slop Cop on 62c0256: no blockers. The old bm25 query fails 9 of the 14 cases; three test-tightening follow-ups were fixed in ca442c6. Follows #5003. BB-Thread: [⌘K improvements](https://brsbl.getbb.app/projects/proj_khiw2za95v/threads/thr_tm8utsbqpb) 🤖 Generated with [Claude Code](https://claude.com/claude-code) > AGENT GENERATED --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Human comments
What was wrong
Thread search ranked threads by the best bm25 score of any segment, so chatty threads outranked exact titles. On a real workspace, "moss plugins" returned three message-only threads before the thread titled "Moss plugins". This order reaches
bb thread search, the SDK, and ⌘K's archived results.What changed
How you verified
Eval details: 4,714 threads, 229,718 segments, median of 7 alternating runs
The expected results were written before any run. Old is base
e710dbd88f. Both used the server's SQLite settings and the app's limit of 20 per group.BB-Thread: ⌘K improvements
🤖 Generated with Claude Code