From a027fb310c735df088060178bc7b615a3a433245 Mon Sep 17 00:00:00 2001 From: LIghtJUNction Date: Mon, 16 Mar 2026 20:34:17 +0800 Subject: [PATCH] Update astrbot/core/computer/tools/shell.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- astrbot/core/computer/tools/shell.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/astrbot/core/computer/tools/shell.py b/astrbot/core/computer/tools/shell.py index dc554c312..251a67f36 100644 --- a/astrbot/core/computer/tools/shell.py +++ b/astrbot/core/computer/tools/shell.py @@ -61,10 +61,10 @@ class ExecuteShellTool(FunctionTool): config = context.context.context.get_config( umo=context.context.event.unified_msg_origin ) - timeout = config.get("provider_settings", {}).get("tool_call_timeout", 30) - # 将timeout转为int - timeout = int(timeout) - + try: + timeout = int(config.get("provider_settings", {}).get("tool_call_timeout", 30)) + except (ValueError, TypeError): + timeout = 30 result = await sb.shell.exec( command, background=background, env=env, timeout=timeout )