From 9ff09b9b93feb12186d7dfc22735f8beabf8970c Mon Sep 17 00:00:00 2001 From: Ariel Frischer Date: Mon, 17 Feb 2025 10:45:49 -0800 Subject: [PATCH] refactor(shell.py): rename expected_runtime_seconds parameter to timeout for clarity and consistency in function signature --- ra_aid/tools/shell.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ra_aid/tools/shell.py b/ra_aid/tools/shell.py index 3065d13..6bcaa3f 100644 --- a/ra_aid/tools/shell.py +++ b/ra_aid/tools/shell.py @@ -22,13 +22,13 @@ def _truncate_for_log(text: str, max_length: int = 300) -> str: @tool def run_shell_command( - command: str, expected_runtime_seconds: int = 30 + command: str, timeout: int = 30 ) -> Dict[str, Union[str, int, bool]]: """Execute a shell command and return its output. Args: command: The shell command to execute - expected_runtime_seconds: Expected runtime in seconds, defaults to 30. + timeout: Expected runtime in seconds, defaults to 30. If process exceeds 2x this value, it will be terminated gracefully. If process exceeds 3x this value, it will be killed forcefully. @@ -83,7 +83,7 @@ def run_shell_command( print() output, return_code = run_interactive_command( ["/bin/bash", "-c", command], - expected_runtime_seconds=expected_runtime_seconds, + expected_runtime_seconds=timeout, ) print() result = {