agent-infra / agent-infra/sandbox

Sandbox 执行代码报错后,没有返回正确的状态和错误信息

Offen
#98 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
5.9k
Forks
529
Ø Merge
4 Std. 8 Min.
Gemergte PRs (30 T.)
4

Beschreibung

生成的 Python 代码如下

```python
# 故意制造异常:不使用 try-except,让程序直接抛出错误
print("About to raise a ZeroDivisionError...")
result = 1 / 0 # ZeroDivisionError
print("This line will never be reached:", result)
```

Sandbox 返回的执行结果, stderr 和 exit_code 均为 null ,无法正确获取到 Exception 的错误信息

```json

{
"id": "aio__sandbox_execute_code_0",
"name": "aio__sandbox_execute_code",
"display_name": "AIO Sandbox",
"arguments": "{\"code\":\"# 故意制造异常:不使用 try-except,让程序直接抛出错误\\nprint('About to raise a ZeroDivisionError...')\\nresult = 1 / 0 # ZeroDivisionError\\nprint('This line will never be reached:', result)\\n\",\"language\":\"python\"}",
"result": "{\n \"status\": \"error\",\n \"stdout\": \"About to raise a ZeroDivisionError...\\n\",\n \"stderr\": null,\n \"exit_code\": null\n}"
}
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.