Description
In \local_browser.py, several synchronous I/O operations run inside async methods, blocking the asyncio event loop:
- _is_local_cdp_available()\ (line 58) and _local_cdp_page_targets()\ (line 73) use \urllib.request\ synchronously
- _ensure_local_cdp_browser()\ (line 262) uses \ ime.sleep(0.2)\ in a polling loop, blocking the loop for up to 10 seconds
- _ensure_local_cdp_page_target()\ (line 93) uses synchronous urllib
\httpx\ is already listed as a dependency in \pyproject.toml\ (line 11) but isn't used anywhere.
Impact
- The event loop is blocked during CDP browser startup for up to 10 seconds
- \ ime.sleep()\ is not interruptible (unlike \�syncio.sleep())
- Concurrent operations on the same event loop cannot make progress
- The polling loop cannot be cancelled mid-wait
Suggested Fix
Replace the synchronous helpers with async versions using \httpx.AsyncClient, convert _ensure_local_cdp_browser\ to async, and use \�syncio.sleep()\ instead of \ ime.sleep().
The fix is straightforward since httpx is already a project dependency.
Description
In \local_browser.py, several synchronous I/O operations run inside async methods, blocking the asyncio event loop:
\httpx\ is already listed as a dependency in \pyproject.toml\ (line 11) but isn't used anywhere.
Impact
Suggested Fix
Replace the synchronous helpers with async versions using \httpx.AsyncClient, convert _ensure_local_cdp_browser\ to async, and use \�syncio.sleep()\ instead of \ ime.sleep().
The fix is straightforward since httpx is already a project dependency.