agent-infra / agent-infra/sandbox
Sandbox 执行代码报错后,没有返回正确的状态和错误信息
- 主要語言
- Python
- 星號
- 5.9k
- 分支
- 529
- 平均合併
- 4 小時 8 分鐘
- 30 天內合併 PR
- 4
描述
生成的 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}"
}
```
貢獻指南
評估
這個 Issue 還沒有評估資料。