fix(harness): align skill prompt with shell tool name - #2677
Open
dangzitou wants to merge 2 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an inconsistency between the Harness “Code Execution” system-prompt text and the actual registered shell tool name by rendering the prompt with ShellExecuteTool.NAME, and adds a regression assertion to prevent future drift.
Changes:
- Render the Harness code-execution prompt using
ShellExecuteTool.NAMEinstead of hardcodingexecute_shell_command. - Add a regression assertion in
SkillRuntimeTestto verify the rendered prompt mentions the registered shell tool name.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| agentscope-harness/src/main/java/io/agentscope/harness/agent/skill/runtime/SkillPromptBuilder.java | Uses ShellExecuteTool.NAME to keep the code-execution prompt aligned with the registered shell tool. |
| agentscope-harness/src/test/java/io/agentscope/harness/agent/skill/runtime/SkillRuntimeTest.java | Adds a focused assertion to catch prompt/tool-name regressions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
80
to
84
| ## Code Execution | ||
|
|
||
| <code_execution> | ||
| You have access to the execute_shell_command tool. Each skill in <available_skills> | ||
| You have access to the %s tool. Each skill in <available_skills> | ||
| includes a <files-root> element giving the absolute path to that skill's files. |
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.
Summary
ShellExecuteTool.NAMEexecute_shell_commandtoolexecutetool nameReproduction
On current
main, the new assertion failed because the rendered prompt did not contain the registered shell tool nameexecute:SkillRuntimeTest: 27 tests run, 1 failurerendersFilesRootAndCodeExecutionWhenAvailableValidation
mvn -pl agentscope-harness -am -Dtest=SkillRuntimeTest -Dsurefire.failIfNoSpecifiedTests=false test— 27 passedmvn -pl agentscope-harness -am test— Core 2274 passed, 9 skipped; Harness 828 passed, 3 skippedgit diff --checkexecute_shell_commandreference remains underagentscope-harnessordocsFixes #2644