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:
@@ -61,10 +61,10 @@ class ExecuteShellTool(FunctionTool):
|
|||||||
config = context.context.context.get_config(
|
config = context.context.context.get_config(
|
||||||
umo=context.context.event.unified_msg_origin
|
umo=context.context.event.unified_msg_origin
|
||||||
)
|
)
|
||||||
timeout = config.get("provider_settings", {}).get("tool_call_timeout", 30)
|
try:
|
||||||
# 将timeout转为int
|
timeout = int(config.get("provider_settings", {}).get("tool_call_timeout", 30))
|
||||||
timeout = int(timeout)
|
except (ValueError, TypeError):
|
||||||
|
timeout = 30
|
||||||
result = await sb.shell.exec(
|
result = await sb.shell.exec(
|
||||||
command, background=background, env=env, timeout=timeout
|
command, background=background, env=env, timeout=timeout
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user