Skip to content

Conversation

@uinstinct
Copy link
Contributor

@uinstinct uinstinct commented Nov 21, 2025

Description

Previously, none of the searches involving regex characters like * or | always produced empty results. Escaping the regex during prepareQueryForRipgrep added escaping characters \ which were passed down to ripgrep. Ripgrep guide suggests the regular expression does not need escaping. If we need to search for exact string, -F flag needs to used.

resolves CON-4741

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-review

Checklist

  • [] I've read the contributing guide
  • [] The relevant docs, if any, have been updated or created
  • [] The relevant tests, if any, have been updated or created

Screen recording or screenshot

before after
image image
image Screenshot 2025-11-21 at 7 25 49 PM

Tests

[ What tests were added or updated to ensure the changes work as expected? ]


Summary by cubic

Fixes ripgrep searches by treating queries as regex patterns and removing accidental escaping, so operators like |, * and character classes now work. Addresses CON-4741.

  • Bug Fixes
    • Removed literal-escaping in prepareQueryForRipgrep; pass queries to ripgrep as-is.
    • Updated GrepSearch tool text to clearly expect a regex pattern.

Written for commit 7e2fb1f. Summary will update automatically on new commits.

@uinstinct uinstinct requested a review from a team as a code owner November 21, 2025 14:01
@uinstinct uinstinct requested review from RomneyDa and removed request for a team November 21, 2025 14:01
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Nov 21, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 2 files

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="core/tools/definitions/grepSearch.ts">

<violation number="1" location="core/tools/definitions/grepSearch.ts:24">
The alternation example in the query description is missing the closing quote, so the illustrated pattern isn’t valid and can confuse users copying it.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

@uinstinct uinstinct changed the title Ripgrep regex fix: regular expressions in ripgrep Nov 21, 2025
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant