fix: remove 'boxlite' option from booter and handle error in PythonTool execution

This commit is contained in:
Soulter
2026-01-13 16:38:04 +08:00
parent a89e7b3f55
commit 6df966e9a2
2 changed files with 7 additions and 2 deletions

View File

@@ -3,8 +3,7 @@
"description": "Select booter to initialize the sandbox environment.",
"type": "string",
"options": [
"shipyard-bay",
"boxlite"
"shipyard-bay"
],
"default": "shipyard-bay"
},

View File

@@ -35,11 +35,17 @@ class PythonTool(FunctionTool):
try:
result = await sb.python.exec(code, silent=silent)
output = result.get("output", {})
error = result.get("error", "")
images: list[dict] = output.get("images", [])
text: str = output.get("text", "")
resp = mcp.types.CallToolResult(content=[])
if error:
resp.content.append(
mcp.types.TextContent(type="text", text=f"error: {error}")
)
if images:
for img in images:
resp.content.append(