From 6ccea96b529e5079c5eaa74feb18b8c69556e1b0 Mon Sep 17 00:00:00 2001 From: Sunny Date: Fri, 3 Apr 2026 00:21:18 +0800 Subject: [PATCH] fix: pass tool_call_timeout to shell.exec for configurable shell timeout --- astrbot/core/computer/tools/shell.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/astrbot/core/computer/tools/shell.py b/astrbot/core/computer/tools/shell.py index b5009d30fd..fed564f15b 100644 --- a/astrbot/core/computer/tools/shell.py +++ b/astrbot/core/computer/tools/shell.py @@ -58,7 +58,11 @@ async def call( context.context.event.unified_msg_origin, ) try: - result = await sb.shell.exec(command, background=background, env=env) + # 从上下文获取工具调用超时时间配置,传递给 shell.exec + timeout = context.tool_call_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)}"