Skip to content

Commit 2e19ab8

Browse files
committed
Timeout
1 parent f508431 commit 2e19ab8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

moatless/actions/run_python_script.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class RunPythonScriptArgs(ActionArguments):
1919

2020
script_path: str = Field(..., description="Path to the Python script to execute")
2121
args: list[str] = Field(default=[], description="Command line arguments to pass to the script")
22-
timeout: int = Field(default=180, description="Timeout in seconds for script execution")
22+
timeout: int = Field(default=30, description="Timeout in seconds for script execution")
2323
max_output_tokens: int = Field(default=2000, description="Maximum number of tokens to return in output")
2424

2525
model_config = ConfigDict(title="RunPythonScript")

moatless/runtime/local.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def __init__(
5959

6060
self._install_task = asyncio.create_task(self._run_async_installation(self._install_command))
6161

62-
async def execute(self, command: str, fail_on_error: bool = False, patch: str | None = None) -> str:
62+
async def execute(self, command: str, fail_on_error: bool = False, patch: str | None = None, timeout: int = 600) -> str:
6363
"""Execute a command in the environment."""
6464
await self._wait_for_install()
6565
try:
@@ -72,7 +72,7 @@ async def execute(self, command: str, fail_on_error: bool = False, patch: str |
7272
stdout, return_code = await self._execute_command(self._install_command)
7373
logger.info(f"Installation output: {stdout} {return_code}")
7474

75-
stdout, return_code = await self._execute_command(command)
75+
stdout, return_code = await self._execute_command(command, timeout=timeout)
7676
logger.info(f"Command {command} returned {return_code}")
7777
logger.info(f"Output: {stdout}")
7878

0 commit comments

Comments
 (0)