Update astrbot/core/computer/tools/shell.py

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
LIghtJUNction
2026-03-16 20:34:17 +08:00
committed by GitHub
parent 4b0d9ae979
commit a027fb310c
+4 -4
View File
@@ -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
)