Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/tools/definitions/grepSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ export const grepSearchTool: Tool = {
function: {
name: BuiltInToolNames.GrepSearch,
description:
"Performs a regex search over the repository using ripgrep. Will not include results for many build, cache, secrets dirs/files. Output may be truncated, so use targeted queries",
"Performs a regular expression (regex) search over the repository using ripgrep. Will not include results for many build, cache, secrets dirs/files. Output may be truncated, so use targeted queries",
parameters: {
type: "object",
required: ["query"],
properties: {
query: {
type: "string",
description:
"The search query to use. Must be the exact string to be searched or a valid ripgrep expression. Use regex with alternation (e.g., 'word1|word2|word3) or character classes to find multiple potential words in a single search.",
"The regex pattern to search for within file contents. Use regex with alternation (e.g., 'word1|word2|word3') or character classes to find multiple potential words in a single search.",
},
},
},
Expand Down
10 changes: 0 additions & 10 deletions core/util/regexValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,6 @@ export function prepareQueryForRipgrep(query: string): {
query: string;
warning?: string;
} {
// Check if it looks like a literal search that should be escaped
if (looksLikeLiteralSearch(query)) {
return {
query: escapeLiteralForRegex(query),
warning:
"Query contained special regex characters and was escaped for literal text search",
};
}

// Otherwise validate and sanitize as regex
const validation = validateAndSanitizeRegex(query);

return {
Expand Down
Loading