Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/strands_tools/browser/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,10 @@ def close(self, action: CloseAction) -> Dict[str, Any]:
return {"status": "error", "content": [{"text": f"Error: {str(e)}"}]}

def _execute_async(self, action_coro) -> Any:
# Ensure the browser's event loop is set on the current thread
# (strands dispatches sync methods to a worker thread)
asyncio.set_event_loop(self._loop)

# Apply nest_asyncio if not already applied
if not self._nest_asyncio_applied:
nest_asyncio.apply()
Expand Down
Loading