将shell调用时的timeout转为int 获取系统配置时正确传递umo

This commit is contained in:
Chen
2026-03-12 03:42:09 +08:00
parent f5e7ca12f7
commit 3dc4bb8e34
+3 -1
View File
@@ -58,8 +58,10 @@ class ExecuteShellTool(FunctionTool):
context.context.event.unified_msg_origin,
)
try:
config = context.context.context.get_config()
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)
return json.dumps(result)