feat(conversations): Add conversation ID to freeform search suggestions#116568
Conversation
📊 Type Coverage Diff✅ No new type safety issues introduced. Coverage: 93.59% |
37ca496 to
ce678c1
Compare
ce678c1 to
df20d88
Compare
Add gen_ai.conversation.id as a secondary replaceRawSearchKeys entry so the search dropdown also suggests contains/is filters for conversation IDs alongside input messages. Refs LINEAR-TET-2425 Co-Authored-By: Claude <noreply@anthropic.com>
df20d88 to
de89584
Compare
…contains-suggestion
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit dcb13e4. Configure here.
| searchSource: 'conversations', | ||
| replaceRawSearchKeys: hasRawSearchReplacement | ||
| ? ['gen_ai.input.messages'] | ||
| ? ['gen_ai.conversation.id', 'gen_ai.input.messages'] |
There was a problem hiding this comment.
Wrong primary raw search key
High Severity
Putting gen_ai.conversation.id first in replaceRawSearchKeys makes it the primary key for automatic free-text replacement on commit, while dropdown suggestions already use every entry via flatMap. Message-style queries that previously became gen_ai.input.messages contains filters can instead become gen_ai.conversation.id contains filters, which breaks the main conversations search path.
Reviewed by Cursor Bugbot for commit dcb13e4. Configure here.
| replaceRawSearchKeys: hasRawSearchReplacement | ||
| ? ['gen_ai.input.messages'] | ||
| ? ['gen_ai.conversation.id', 'gen_ai.input.messages'] |
There was a problem hiding this comment.
Bug: Free-text search in the conversations view is broken. It now incorrectly defaults to searching by gen_ai.conversation.id instead of message content, causing searches to fail.
Severity: HIGH
Suggested Fix
The logic for determining the primary search key for free-text queries should not rely solely on the first element of the replaceRawSearchKeys array. The implementation should be updated to ensure gen_ai.input.messages is used for free-text searches, while still allowing gen_ai.conversation.id to be an option in the search suggestions dropdown.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: static/app/views/explore/conversations/overview.tsx#L87-L88
Potential issue: In the conversations search view, the code that handles free-text
search queries was modified to support searching by conversation ID. However, the
implementation incorrectly prioritizes this new search key. The logic in
`useQueryBuilderState.tsx` uses only the first element of the `replaceRawSearchKeys`
array as the primary key for any free-text search. This pull request changes the array
to `['gen_ai.conversation.id', 'gen_ai.input.messages']`, making
`gen_ai.conversation.id` the new default. Consequently, when a user types natural
language text (expecting to search message content) and presses enter, the query is
incorrectly formatted as a search for a conversation ID, which will fail and return no
results.
Did we get this right? 👍 / 👎 to inform future reviews.


Add
gen_ai.conversation.idas areplaceRawSearchKeysentry so the search dropdown suggests contains/is filters for conversation IDs alongside input messages.Refs TET-2425