Skip to content

fix sandbox glob_files recursive patterns#1684

Merged
chickenlj merged 5 commits into
agentscope-ai:mainfrom
gaoxiaolei-s59:codex/fix-1674-glob-files-recursive-pattern
Jun 11, 2026
Merged

fix sandbox glob_files recursive patterns#1684
chickenlj merged 5 commits into
agentscope-ai:mainfrom
gaoxiaolei-s59:codex/fix-1674-glob-files-recursive-pattern

Conversation

@gaoxiaolei-s59

Copy link
Copy Markdown
Contributor

Summary

  • normalize leading **/ in sandbox glob() before passing the pattern to find -name
  • add a regression test covering glob_files calls like **/*.md

Root Cause

The glob_files tool description advertises recursive patterns such as **/*.java, but BaseSandboxFilesystem.glob() forwarded that pattern directly to find -name. find -name matches 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

@CLAassistant

CLAassistant commented Jun 10, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...gent/filesystem/sandbox/BaseSandboxFilesystem.java 60.00% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@gaoxiaolei-s59 gaoxiaolei-s59 marked this pull request as ready for review June 10, 2026 02:07
@gaoxiaolei-s59 gaoxiaolei-s59 requested a review from a team June 10, 2026 02:07
@AgentScopeJavaBot AgentScopeJavaBot added bug Something isn't working area/harness agentscope-harness (test/runtime support) labels Jun 10, 2026

@AgentScopeJavaBot AgentScopeJavaBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 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 AgentScopeJavaBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 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.

gaoxiaolei-s59 and others added 3 commits June 11, 2026 10:52
…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.
@chickenlj chickenlj merged commit 1a497fb into agentscope-ai:main Jun 11, 2026
6 checks passed
@gaoxiaolei-s59 gaoxiaolei-s59 changed the title [codex] fix sandbox glob_files recursive patterns fix sandbox glob_files recursive patterns Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/harness agentscope-harness (test/runtime support) bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants