Seems like its happening due to use of await on synchronous handle_event in the client.py
handled = await self._event_registry.handle_event(
method, params, session_id
)
def handle_event(
self,
method: str,
params: Any,
session_id: Optional[str] = None,
) -> bool:
"""
Handle an incoming CDP event.
...
Returns:
True if a handler was found and called, False otherwise
"""
if method in self._handlers:
try:
self._handlers[method](params, session_id)
return True
except Exception as e:
logger.error(f"Error in event handler for {method}: {e}")
return False
return False