Skip to content

feat(conversations): Add conversation ID to freeform search suggestions#116568

Merged
obostjancic merged 2 commits into
masterfrom
ognjenbostjancic/tet-2425-conversation-id-contains-suggestion
Jun 1, 2026
Merged

feat(conversations): Add conversation ID to freeform search suggestions#116568
obostjancic merged 2 commits into
masterfrom
ognjenbostjancic/tet-2425-conversation-id-contains-suggestion

Conversation

@obostjancic
Copy link
Copy Markdown
Member

@obostjancic obostjancic commented Jun 1, 2026

Add gen_ai.conversation.id as a replaceRawSearchKeys entry so the search dropdown suggests contains/is filters for conversation IDs alongside input messages.

Refs TET-2425

@linear-code
Copy link
Copy Markdown

linear-code Bot commented Jun 1, 2026

TET-2425

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jun 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.59%

@obostjancic obostjancic force-pushed the ognjenbostjancic/tet-2425-conversation-id-contains-suggestion branch from 37ca496 to ce678c1 Compare June 1, 2026 13:32
@obostjancic obostjancic force-pushed the ognjenbostjancic/tet-2425-conversation-id-contains-suggestion branch from ce678c1 to df20d88 Compare June 1, 2026 13:37
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>
@obostjancic obostjancic force-pushed the ognjenbostjancic/tet-2425-conversation-id-contains-suggestion branch from df20d88 to de89584 Compare June 1, 2026 13:40
@obostjancic obostjancic marked this pull request as ready for review June 1, 2026 13:58
@obostjancic obostjancic requested a review from a team as a code owner June 1, 2026 13:58
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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']
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit dcb13e4. Configure here.

Comment on lines 87 to +88
replaceRawSearchKeys: hasRawSearchReplacement
? ['gen_ai.input.messages']
? ['gen_ai.conversation.id', 'gen_ai.input.messages']
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@obostjancic obostjancic merged commit 8f1beaa into master Jun 1, 2026
76 checks passed
@obostjancic obostjancic deleted the ognjenbostjancic/tet-2425-conversation-id-contains-suggestion branch June 1, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants