diff --git a/astrbot/core/computer/tools/shell.py b/astrbot/core/computer/tools/shell.py index b5009d30fd..251a67f361 100644 --- a/astrbot/core/computer/tools/shell.py +++ b/astrbot/core/computer/tools/shell.py @@ -58,7 +58,16 @@ async def call( context.context.event.unified_msg_origin, ) try: - result = await sb.shell.exec(command, background=background, env=env) + config = context.context.context.get_config( + umo=context.context.event.unified_msg_origin + ) + 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 + ) return json.dumps(result) except Exception as e: return f"Error executing command: {str(e)}"