@@ -206,7 +206,7 @@ func (g *grepTool) Run(ctx context.Context, call ToolCall) (ToolResponse, error)
206 searchPath = g.workingDir
206 searchPath = g.workingDir
209− matches, truncated, err := searchFiles(searchPattern, searchPath, params.Include, 100)
209+ matches, truncated, err := searchFiles(ctx, searchPattern, searchPath, params.Include, 100)
210 if err != nil {
210 if err != nil {
211 return ToolResponse{}, fmt.Errorf("error searching files: %w", err)
211 return ToolResponse{}, fmt.Errorf("error searching files: %w", err)
@@ -247,8 +247,8 @@ func (g *grepTool) Run(ctx context.Context, call ToolCall) (ToolResponse, error)
250−func searchFiles(pattern, rootPath, include string, limit int) ([]grepMatch, bool, error) {
250+func searchFiles(ctx context.Context, pattern, rootPath, include string, limit int) ([]grepMatch, bool, error) {
251− matches, err := searchWithRipgrep(pattern, rootPath, include)
251+ matches, err := searchWithRipgrep(ctx, pattern, rootPath, include)
252 if err != nil {
252 if err != nil {
253 matches, err = searchFilesWithRegex(pattern, rootPath, include)
253 matches, err = searchFilesWithRegex(pattern, rootPath, include)
254 if err != nil {
254 if err != nil {
@@ -268,8 +268,8 @@ func searchFiles(pattern, rootPath, include string, limit int) ([]grepMatch, boo
268 return matches, truncated, nil
268 return matches, truncated, nil
271−func searchWithRipgrep(pattern, path, include string) ([]grepMatch, error) {
271+func searchWithRipgrep(ctx context.Context, pattern, path, include string) ([]grepMatch, error) {
272− cmd := fsext.GetRgSearchCmd(pattern, path, include)
272+ cmd := fsext.GetRgSearchCmd(ctx, pattern, path, include)
273 if cmd == nil {
273 if cmd == nil {
274 return nil, fmt.Errorf("ripgrep not found in $PATH")
274 return nil, fmt.Errorf("ripgrep not found in $PATH")