Fix ctrl c not working during startup (#4155)

This commit is contained in:
tofarr
2024-10-01 21:05:00 -06:00
committed by GitHub
parent 5a45c648a8
commit 4eaf28d7b1
7 changed files with 25 additions and 11 deletions

View File

@@ -16,6 +16,7 @@ from PIL import Image
from openhands.core.exceptions import BrowserInitException
from openhands.core.logger import openhands_logger as logger
from openhands.utils.tenacity_stop import stop_if_should_exit
from openhands.runtime.utils.shutdown_listener import should_continue, should_exit
BROWSER_EVAL_GET_GOAL_ACTION = 'GET_EVAL_GOAL'
@@ -52,7 +53,7 @@ class BrowserEnv:
@tenacity.retry(
wait=tenacity.wait_fixed(1),
stop=tenacity.stop_after_attempt(5),
stop=tenacity.stop_after_attempt(5) | stop_if_should_exit(),
retry=tenacity.retry_if_exception_type(BrowserInitException),
)
def init_browser(self):