Skip to content

fix(harness): align skill prompt with shell tool name - #2677

Open
dangzitou wants to merge 2 commits into
agentscope-ai:mainfrom
dangzitou:agent/fix-harness-shell-prompt
Open

fix(harness): align skill prompt with shell tool name#2677
dangzitou wants to merge 2 commits into
agentscope-ai:mainfrom
dangzitou:agent/fix-harness-shell-prompt

Conversation

@dangzitou

@dangzitou dangzitou commented Aug 12, 2026

Copy link
Copy Markdown

Summary

  • render the Harness skill code-execution prompt with the registered ShellExecuteTool.NAME
  • prevent the prompt from directing models to the unavailable execute_shell_command tool
  • add a focused regression assertion to keep the prompt and tool registration aligned
  • update the English and Chinese Harness skill/workspace docs to use the registered execute tool name

Reproduction

On current main, the new assertion failed because the rendered prompt did not contain the registered shell tool name execute:

  • SkillRuntimeTest: 27 tests run, 1 failure
  • failing test: rendersFilesRootAndCodeExecutionWhenAvailable

Validation

  • mvn -pl agentscope-harness -am -Dtest=SkillRuntimeTest -Dsurefire.failIfNoSpecifiedTests=false test — 27 passed
  • mvn -pl agentscope-harness -am test — Core 2274 passed, 9 skipped; Harness 828 passed, 3 skipped
  • Spotless checks passed as part of both Maven runs
  • git diff --check
  • verified no stale execute_shell_command reference remains under agentscope-harness or docs

Fixes #2644

@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@dangzitou
dangzitou marked this pull request as ready for review August 12, 2026 19:54
Copilot AI lite review requested due to automatic review settings August 12, 2026 19:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.NAME instead of hardcoding execute_shell_command.
  • Add a regression assertion in SkillRuntimeTest to 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.
@AgentScopeJavaBot AgentScopeJavaBot added bug Something isn't working area/harness agentscope-harness (test/runtime support) area/docs Documentation labels Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docs Documentation 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.

harnessAgent sanbox shell tool prompt not inconsistent of system prompt

3 participants