Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix search_files_by_name to properly handle glob patterns with ** #914

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

codegen-sh[bot]
Copy link
Contributor

@codegen-sh codegen-sh bot commented Mar 19, 2025

Description

This PR fixes an issue with the search_files_by_name tool where it wasn't properly handling glob patterns that include ** (recursive directory matching), such as **/.github/workflows/*.yml.

Changes

  1. Improved handling of glob patterns with ** for both fd and find commands
  2. Added specific handling for patterns that start with **/
  3. For find, using -path instead of -name when the pattern contains **
  4. For fd, added the -t f flag to ensure we're only finding files
  5. Added filtering to remove empty strings from results
  6. Updated documentation to include example with **/.github/workflows/*.yml

Testing

This change should allow patterns like **/.github/workflows/*.yml to correctly find GitHub workflow files at any directory depth.

Fixes the issue reported in Slack where search_files_by_name wasn't finding GitHub workflow files with the pattern **/.github/workflows/*.yml.

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.

0 participants