fix sandbox glob_files recursive patterns#1684
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This PR fixes a real bug: glob_files in sandbox mode advertised support for recursive patterns like **/*.java, but the implementation forwarded the pattern directly to find -name, which only matches the filename portion. The fix correctly strips the leading **/ prefix since find already performs recursive directory traversal. The change is minimal, null-safe, and well-tested with a new BaseSandboxFilesystemTest using a clean fake-sandbox design. One minor symmetry observation regarding the sibling grep method is noted below.
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This PR fixes a real bug: glob_files in sandbox mode advertised support for recursive patterns like **/*.java, but the implementation forwarded the pattern directly to find -name, which only matches the filename portion. The fix correctly strips the leading **/ prefix since find already performs recursive directory traversal. The change is minimal, null-safe, and well-tested with a new BaseSandboxFilesystemTest using a clean fake-sandbox design. One minor symmetry observation regarding the sibling grep method is noted below.
…helper grep --include= matches only the filename portion (like find -name), so passing **/*.java would silently return no matches. Apply the same stripRecursivePrefix() normalization that glob() already used, and extract it into a shared private helper to avoid duplication.
Summary
**/in sandboxglob()before passing the pattern tofind -nameglob_filescalls like**/*.mdRoot Cause
The
glob_filestool description advertises recursive patterns such as**/*.java, butBaseSandboxFilesystem.glob()forwarded that pattern directly tofind -name.find -namematches the filename portion only, so the leading**/caused sandbox-backed recursive glob calls to return no matches.Validation
mvn -pl agentscope-harness -am -Dtest=BaseSandboxFilesystemTest,FilesystemGlobTest test