agentscope-ai / agentscope-ai/agentscope-java

[Bug]:window系统下执行任何命令工具 execute 总是出错

Open
#2,271 1 comment 0 reactions 0 assignees View on GitHub
area/harness bug good first issue
Dominant language
Java
Stars
5.6k
Forks
1.3k
Avg merge
4d 12h
Merged PRs (30d)
77

Description

**AgentScope-Java is an open-source project. To involve a broader community, we recommend asking your questions in English.**

**Describe the bug**
window系统下执行命令工具 execute 总是出错,任何命令都是。经过AI分析发现原来是 ShellExecuteTool 代码中没有判断当前环境是Windows还是Linux导致。就是这一行用了 Unix 单引号语法,在 Windows cmd.exe 下会报错。

Image

需要改成如下:

Image

**To Reproduce**
window系统下执行命令工具 execute 总是出错,任何命令都是,如下图
Image

**Expected behavior**
Windows环境下可以正常执行cmd命令

**Error messages**
- stderr:文件名、目录名或卷标语法不正确

**Environment (please complete the following information):**

- AgentScope-Java Version:2.0.0-RC5
- Java Version: [e.g. 17]
- OS: [windows]

**Additional context**
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.