Skip to content

Conversation

@msukkari
Copy link
Contributor

Wraps the user's search query in quotes and escapes special characters to fix Ask failing to handle file names with special characters like (pr.

The query language parser treated special characters (e.g., () in the user's raw search query as operators, leading to parsing errors. By quoting the entire query and escaping internal special characters, the parser now correctly interprets the query as a literal string pattern.


Linear Issue: SOU-245

Open in Cursor Open in Web

This fixes the issue where files with special characters like '(pr'
could not be found through the Ask feature. The problem was that
parentheses and other special characters in the LLM's search query
were interpreted as query language operators instead of literal regex.

The fix wraps the query in quotes and properly escapes internal
special characters (backslashes, quotes, newlines) before constructing
the search query. This ensures the query parser treats the pattern as
a literal regex string.

Fixes SOU-245

Co-authored-by: michael <michael@sourcebot.dev>
@cursor
Copy link

cursor bot commented Jan 22, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants