π OpenHands: AI-Driven Development
fix browser async lock (#6316)
Robert Brennan9375e0d75676
diff --git a/openhands/runtime/browser/utils.py b/openhands/runtime/browser/utils.pyindex 6f823e47d5..45e098c9f7 100644--- a/openhands/runtime/browser/utils.py+++ b/openhands/runtime/browser/utils.py@@ -5,6 +5,7 @@ from openhands.core.schema import ActionTypefrom openhands.events.action import BrowseInteractiveAction, BrowseURLActionfrom openhands.events.observation import BrowserOutputObservationfrom openhands.runtime.browser.browser_env import BrowserEnv+from openhands.utils.async_utils import call_sync_from_asyncasync def browse(@@ -29,7 +30,7 @@ async def browse(try:# obs provided by BrowserGym: see https://github.com/ServiceNow/BrowserGym/blob/main/core/src/browsergym/core/env.py#L396- obs = browser.step(action_str)+ obs = await call_sync_from_async(browser.step, action_str)return BrowserOutputObservation(content=obs['text_content'], # text content of the pageurl=obs.get('url', ''), # URL of the page