Skip to content

docs(harness): clarify grep_files/edit_file/glob_files tool descriptions#2243

Open
wzq-xzwj wants to merge 1 commit into
agentscope-ai:mainfrom
wzq-xzwj:docs/clarify-tool-descriptions
Open

docs(harness): clarify grep_files/edit_file/glob_files tool descriptions#2243
wzq-xzwj wants to merge 1 commit into
agentscope-ai:mainfrom
wzq-xzwj:docs/clarify-tool-descriptions

Conversation

@wzq-xzwj

Copy link
Copy Markdown

Summary

Improve the descriptions of three harness built-in tools so models pick the
right tool and pass valid arguments. Documentation-only; no behavior change.

Changes

grep_filesglob parameter
Clarify that the filter is matched against the file name only, and that
path-based patterns such as **/*.java are not supported here. The search
already recurses into subdirectories, so a bare *.java is what's expected.
This reflects the javaSearch fallback in LocalFilesystem, which filters via
path.getFileName():

if (finalGlobMatcher != null) {
    return finalGlobMatcher.matches(p.getFileName());
}

edit_fileold_string parameter
Note at the parameter level that old_string must match exactly once unless
replace_all is true, otherwise the edit fails. Previously this was only stated
in the method-level description.

glob_files — tool description
Clarify that it finds files by name, and point to grep_files for searching
file contents, reducing tool-selection confusion.

Rationale

These descriptions are surfaced to the model in the tool schema. Vague or missing
guidance leads models to, e.g., pass **/*.java to grep_files (which then
matches nothing via the Java fallback), or to confuse glob_files with
grep_files.

Testing

  • mvn -pl agentscope-harness spotless:check → BUILD SUCCESS.
  • No logic changed; only annotation description strings.

…les usage

Improve tool descriptions to reduce model confusion, without changing behavior:

- grep_files `glob`: state that the filter matches the file name only and that
  path-based patterns like **/*.java are not supported here (the search already
  recurses into subdirectories). This reflects the javaSearch fallback, which
  matches against `path.getFileName()`.
- edit_file `old_string`: note it must match exactly once unless replace_all is
  true, otherwise the edit fails (previously only stated at the method level).
- glob_files: clarify it finds files by name and point to grep_files for content
  search, so models pick the right tool.

@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

Aspect Count
🟢 Nitpick (信息性建议,不阻塞合并) 1
🟡 Recommended (建议修复,但不阻塞合并) 1

Overall Assessment: COMMENT — 文档改进方向正确,但 grep_filesglob 描述与 ripgrep 实现不一致,建议修正描述或统一实现。

@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

Aspect Count
🟢 Nitpick (信息性建议,不阻塞合并) 1
🟡 Recommended (建议修复,但不阻塞合并) 1

Overall Assessment: COMMENT — 文档改进方向正确,但 grep_filesglob 描述与 ripgrep 实现不一致,建议修正描述或统一实现。

@AgentScopeJavaBot AgentScopeJavaBot added the area/harness agentscope-harness (test/runtime support) label Jul 16, 2026
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants