Skip to content

Commit be1dfe4

Browse files
revert handler
1 parent d3a2bcf commit be1dfe4

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

stagehand/handlers/act_handler.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import asyncio
21
import traceback
32
from typing import Any, Optional, Union
43

@@ -47,31 +46,6 @@ async def act(self, options: Union[ActOptions, ObserveResult]) -> ActResult:
4746
options, self.stagehand.dom_settle_timeout_ms
4847
)
4948

50-
# Extract timeout_ms from options (check both snake_case and camelCase)
51-
## TODO - this is a temporary fix to support the timeout_ms field in the options.
52-
## We should update the options to use the timeout_ms field instead of timeoutMs.
53-
timeout_ms = options.get("timeout_ms") or options.get("timeoutMs")
54-
55-
# If timeout is specified, wrap the entire act operation with asyncio.wait_for
56-
if timeout_ms:
57-
try:
58-
return await asyncio.wait_for(
59-
self._perform_act_with_timeout(options),
60-
timeout=timeout_ms / 1000.0, # Convert ms to seconds
61-
)
62-
except asyncio.TimeoutError:
63-
action_task = options.get("action")
64-
return ActResult(
65-
success=False,
66-
message=f"Action timed out after {timeout_ms}ms",
67-
action=action_task,
68-
)
69-
else:
70-
# No timeout specified, use existing behavior
71-
return await self._perform_act_with_timeout(options)
72-
73-
async def _perform_act_with_timeout(self, options) -> ActResult:
74-
"""Extract the main act logic into a separate method for timeout handling"""
7549
# Start inference timer if available
7650
if hasattr(self.stagehand, "start_inference_timer"):
7751
self.stagehand.start_inference_timer()

0 commit comments

Comments
 (0)