Skip to content

fix(harness): clarify skill shell path handling - #3026

Open
ZHCHJ888 wants to merge 1 commit into
agentscope-ai:mainfrom
ZHCHJ888:fix/skill-shell-path-guidance
Open

fix(harness): clarify skill shell path handling#3026
ZHCHJ888 wants to merge 1 commit into
agentscope-ai:mainfrom
ZHCHJ888:fix/skill-shell-path-guidance

Conversation

@ZHCHJ888

@ZHCHJ888 ZHCHJ888 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

AgentScope-Java Version

2.0.3-SNAPSHOT

Description

Fixes #2788.

Skill execution guidance previously referred to a non-existent execute_shell_command tool and could lead agents to pass an absolute <files-root> path as working_directory. However, working_directory intentionally accepts only workspace-relative paths, so this caused skill script execution to be rejected.

This PR:

  • Uses the actual execute tool name in the generated skill prompt.
  • Clarifies that absolute skill paths belong in command, while working_directory must remain workspace-relative or be omitted.
  • Improves the tool schema and validation error with recovery guidance without relaxing the workspace security boundary.
  • Adds regression coverage for the generated prompt, rejected absolute working directories, and the exposed tool schema.
  • Updates the English and Chinese skill documentation and examples.

How to test:

mvn -pl agentscope-harness -am -Dtest=SkillRuntimeTest,ShellExecuteToolTest -Dsurefire.failIfNoSpecifiedTests=false test
mvn -pl agentscope-harness -am -Dtest='io.agentscope.harness.**.*Test' -Dsurefire.failIfNoSpecifiedTests=false clean verify

Local results: 34 targeted tests passed. The clean Harness verification passed 989 tests with 6 environment-dependent tests skipped on Windows (5 Windows-disabled shell integration tests and 1 POSIX-permissions assumption).

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has been formatted with mvn spotless:apply
  • All tests are passing (mvn test)
  • Javadoc comments are complete and follow project conventions
  • Related documentation has been updated (e.g. links, examples, etc.)
  • Code is ready for review

@codecov

codecov Bot commented Sep 8, 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

## Code Execution says "alwasy use absolute paths from <File-root>" ,but execute tool's working diretory rejects them

1 participant