Repository navigation
Conversation
Use the existing JSON codec so quotes, backslashes and tabs reach grep callers as file text instead of escaped or truncated fragments. Cover the public grep path with process-output fixtures and update the English and Chinese filesystem guides. Refs agentscope-ai#4134
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
This was referenced Nov 12, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AgentScope-Java Version
2.1.0-SNAPSHOT
Description
Fixes #4134
Local grep results are currently parsed by slicing JSON strings at the next quote. This truncates quoted source lines and leaves escaped backslashes, tabs and line endings in the text returned to the agent.
Use the existing JSON codec to read match events, then remove the decoded line terminator. Handle both
lines.textand Base64lines.bytes, replacing invalid UTF-8 line bytes with U+FFFD. Remove the three string-extraction helpers. Search arguments, path resolution and the Java fallback are unchanged. Non-UTF-8 filenames remain unsupported; they are not resolved to replacement-character paths.Add eleven regression cases through the public
grepmethod using process-output fixtures, so they run without installing ripgrep. They cover quoted text, backslashes, tabs, Unicode, literal escape sequences, escaped paths, JSON whitespace, byte-encoded lines and malformed records. The real ripgrep/publicgreppath was also checked locally.Validation on Windows 11 with JDK 17:
mvn -T1C -pl agentscope-harness -am -Dtest='*Filesystem*Test,*FilesystemTest*,FilesystemToolTest,BoundedFileReadTest' -Dsurefire.failIfNoSpecifiedTests=false test spotless:check: 265 passed, 34 skipped by existing Windows/symlink conditions, no failures or errors. Spotless passed across the selected reactor. This is a scoped run, not the full repository suite.npm run validatepassed.npm run broken-linksreports 2,230 broken links in 328 files on both the original and modified documentation, with identical results.AI assistance was used for implementation and test preparation. A separate review agent reviewed the final commit; its byte-payload finding was fixed and re-reviewed before submission.
Checklist
mvn spotless:applymvn test); scoped validation is listed above, the full suite was not run.