refactor(shell.py): rename expected_runtime_seconds parameter to timeout for clarity and consistency in function signature

This commit is contained in:
Ariel Frischer 2025-02-17 10:45:49 -08:00
parent 81354df48b
commit 9ff09b9b93
1 changed files with 3 additions and 3 deletions

View File

@ -22,13 +22,13 @@ def _truncate_for_log(text: str, max_length: int = 300) -> str:
@tool @tool
def run_shell_command( def run_shell_command(
command: str, expected_runtime_seconds: int = 30 command: str, timeout: int = 30
) -> Dict[str, Union[str, int, bool]]: ) -> Dict[str, Union[str, int, bool]]:
"""Execute a shell command and return its output. """Execute a shell command and return its output.
Args: Args:
command: The shell command to execute 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 2x this value, it will be terminated gracefully.
If process exceeds 3x this value, it will be killed forcefully. If process exceeds 3x this value, it will be killed forcefully.
@ -83,7 +83,7 @@ def run_shell_command(
print() print()
output, return_code = run_interactive_command( output, return_code = run_interactive_command(
["/bin/bash", "-c", command], ["/bin/bash", "-c", command],
expected_runtime_seconds=expected_runtime_seconds, expected_runtime_seconds=timeout,
) )
print() print()
result = { result = {