This commit is contained in:
Chen
2026-03-12 03:44:36 +08:00
parent 3dc4bb8e34
commit b1a119edb4
+7 -3
View File
@@ -58,12 +58,16 @@ class ExecuteShellTool(FunctionTool):
context.context.event.unified_msg_origin,
)
try:
config = context.context.context.get_config(umo=context.context.event.unified_msg_origin)
config = context.context.context.get_config(
umo=context.context.event.unified_msg_origin
)
timeout = config.get("provider_settings", {}).get("shell_call_timeout", 30)
# 将timeout转为int
timeout = int(timeout)
result = await sb.shell.exec(command, background=background, env=env, timeout=timeout)
result = await sb.shell.exec(
command, background=background, env=env, timeout=timeout
)
return json.dumps(result)
except Exception as e:
return f"Error executing command: {str(e)}"