agentscope-ai / agentscope-ai/agentscope-java

[BUG]: 使用默认镜像运行沙箱命令,write_file和edit_file工具报错

Aperta
#2,365 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
area/extensions bug
Lingua principale
Java
Stelle
5.6k
Fork
1.3k
Merge medio
4g 12h
PR unite (30g)
77

Descrizione

# 运行版本:

2.0 GA

# 运行环境:

windows 10 + docker+ubuntu:22.04镜像

# 问题描述:

我在windows10下使用docker沙箱方式运行智能体,我用的默认镜像ubuntu:22.04

通过跟踪代码发现,BaseSandboxFilesystem.write方法执行如下命令:
``` bash
"if [ -e 'outputs/f1b0c43599814be3bcfc2778c1d7bd72zzz/test3.txt' ]; then echo 'EXISTS'; exit 1; fi; mkdir -p "$(dirname 'outputs/f1b0c43599814be3bcfc2778c1d7bd72zzz/test3.txt')" 2>&1"
```

checkResult返回如下信息:
``` bash
"'outputs/f1b0c43599814be3bcfc2778c1d7bd72zzz/test3.txt') 2>&1: 1: Syntax error: end of file unexpected (expecting ")")"
```
checkResult.exitCode是2

此时程序报错信息:
``` bash
"Error: Failed to write file 'outputs/f1b0c43599814be3bcfc2778c1d7bd72zzz/test3.txt'"
```

另外,调用BaseSandboxFilesystem.edit时, 会报如下错误:
``` bash
unexpected server response: sys,: 1: python3: not found
```

# 期望结果

1、报错信息应能反应明确的出错原因。
2、使用源代码默认的镜像,应能正确运行相关命令。否则,请给出特定镜像版本要求。

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.