Teknium
d93c905808
fix: /browser connect times out when another app squats the CDP port
...
On Windows (and some Linux setups), an application like VS Code's
js-debug can hold 127.0.0.1:9222 while a Chromium browser launched
with --remote-debugging-port=9222 silently binds [::1]:9222 only.
The IPv4-only probe then (a) missed the live browser entirely and
(b) hung against the squatter — which accepts TCP but never answers
the /json/version HTTP probe — repeatedly, driving the whole connect
past the desktop GUI's RPC deadline:
'error: request timed out: browser.manage'.
Fix, applied to both the gateway browser.manage RPC and the CLI
/browser connect path via shared helpers in browser_connect.py:
- discover_local_cdp_url(): probe BOTH loopbacks (127.0.0.1 first,
then [::1]) and adopt whichever actually speaks CDP.
- local_port_in_use() + find_free_debug_port(): when neither loopback
speaks CDP but the port is held by another application, report the
squatter explicitly and launch the debug browser on a nearby free
port instead of fighting a bind conflict on 9222.
- Bound the gateway's post-launch wait to a 10s deadline (was up to
20 unbounded probe cycles) so connect always answers inside the
client RPC timeout.
- _wait_for_browser_debug_ready_or_exit() also probes dual-stack so a
successful launch pushed onto [::1] is classified 'ready'.
Verified on a live Windows repro (VS Code holding 127.0.0.1:9222,
Chrome 148 on [::1]:9222): connect now resolves http://[::1]:9222
in ~4.5s instead of timing out.
2026-07-18 02:49:28 -07:00
..
2026-07-17 15:47:08 -07:00
2026-06-28 05:49:21 -07:00
2026-07-01 02:18:56 -07:00
2026-07-17 20:55:24 +00:00
2026-07-11 03:51:43 -07:00
2026-07-17 11:37:25 +05:30
2026-07-02 13:17:41 -07:00
2026-07-10 17:50:43 +05:30
2026-07-16 06:14:56 -07:00
2026-07-16 22:56:45 -04:00
2026-07-02 13:17:41 -07:00
2026-07-17 19:16:48 -04:00
2026-07-16 22:24:45 -07:00
2026-07-11 12:28:55 +05:30
2026-07-18 02:31:20 -07:00
2026-07-06 11:17:41 -07:00
2026-06-27 11:45:07 -07:00
2026-07-15 09:59:38 -07:00
2026-07-18 14:30:24 +05:30
2026-07-18 02:49:28 -07:00
2026-06-27 15:59:00 -07:00
2026-07-16 15:45:07 +00:00
2026-07-10 00:47:51 +05:30
2026-07-01 23:51:54 +05:30
2026-07-12 00:26:49 -07:00
2026-07-09 18:23:18 -07:00
2026-07-15 04:26:20 -07:00
2026-07-12 03:05:12 -07:00
2026-07-17 04:33:34 -07:00
2026-07-16 14:30:05 +10:00
2026-07-05 00:44:15 -07:00
2026-06-30 03:27:41 -07:00
2026-07-09 14:30:16 +05:30
2026-06-23 23:39:22 -07:00
2026-07-17 04:58:35 -07:00
2026-07-06 02:21:32 -07:00
2026-07-06 12:26:21 -07:00
2026-07-11 12:28:55 +05:30
2026-07-05 00:55:51 -07:00
2026-07-02 04:51:56 +05:30
2026-07-16 19:52:53 -04:00
2026-07-14 07:02:05 -07:00
2026-07-14 07:02:05 -07:00
2026-06-26 19:15:18 -07:00
2026-06-29 04:25:18 -07:00
2026-07-09 12:21:16 +05:30
2026-07-06 03:18:02 -07:00
2026-06-26 19:15:18 -07:00
2026-07-03 20:18:00 +05:30
2026-07-16 19:49:39 -04:00
2026-07-09 12:21:16 +05:30
2026-06-27 10:08:13 +10:00
2026-07-09 14:48:50 +05:30
2026-07-01 00:38:17 -07:00
2026-07-09 16:13:59 -05:00
2026-07-01 02:18:56 -07:00
2026-06-30 17:29:23 -07:00
2026-07-09 20:03:11 -07:00
2026-07-02 19:52:18 -05:00
2026-07-17 15:01:54 -04:00
2026-06-28 22:53:56 -07:00
2026-06-28 18:53:00 -07:00
2026-07-16 07:19:36 -07:00
2026-07-11 05:43:35 -07:00
2026-07-16 05:08:56 -07:00
2026-07-01 02:48:36 -07:00
2026-07-16 01:19:29 -07:00
2026-06-27 15:59:00 -07:00
2026-06-28 04:09:54 -07:00
2026-06-28 18:05:28 -05:00
2026-07-15 07:39:17 -07:00
2026-07-10 00:47:51 +05:30
2026-07-16 20:45:05 -04:00
2026-07-09 20:03:11 -07:00
2026-07-15 07:39:42 -07:00
2026-07-05 05:35:44 -07:00
2026-07-11 05:43:07 -07:00
2026-07-18 02:31:20 -07:00
2026-07-01 16:25:48 -05:00
2026-06-25 21:46:58 -07:00
2026-07-15 07:39:17 -07:00
2026-07-16 07:33:14 -07:00
2026-07-12 23:09:41 -07:00
2026-07-15 07:39:17 -07:00
2026-07-09 16:13:59 -05:00
2026-06-25 21:46:58 -07:00
2026-06-25 16:40:26 -05:00
2026-07-15 07:39:17 -07:00
2026-07-11 03:51:43 -07:00
2026-06-28 02:44:04 -07:00
2026-06-27 03:43:38 -07:00
2026-07-12 03:08:08 -07:00
2026-07-05 19:10:00 -07:00
2026-07-15 04:56:25 -07:00
2026-07-17 04:50:47 -07:00
2026-07-17 04:50:47 -07:00
2026-06-27 04:59:23 +05:30
2026-07-07 04:09:35 -07:00
2026-07-05 23:00:34 +05:30
2026-07-17 13:49:12 -07:00
2026-07-15 00:10:31 -07:00
2026-07-03 03:33:06 -07:00
2026-07-06 02:46:24 -07:00
2026-07-10 13:10:30 +05:30
2026-07-12 03:04:07 -07:00
2026-07-17 15:47:08 -07:00
2026-07-14 03:11:19 -07:00
2026-07-16 13:33:02 -07:00
2026-07-15 00:10:31 -07:00
2026-07-18 14:30:24 +05:30
2026-07-01 05:06:00 -07:00
2026-07-02 06:52:46 +00:00
2026-07-07 00:53:56 -07:00
2026-07-06 11:10:51 -07:00
2026-06-27 21:23:25 -07:00
2026-07-07 21:13:19 -07:00
2026-07-01 04:05:15 -07:00
2026-07-06 04:38:17 -07:00
2026-07-06 11:20:47 -07:00
2026-07-07 15:14:30 -07:00
2026-07-15 07:39:17 -07:00
2026-07-05 00:48:50 -07:00
2026-06-24 07:46:54 -07:00
2026-06-25 16:40:26 -05:00
2026-06-25 16:40:26 -05:00
2026-07-05 19:13:20 -07:00
2026-07-05 11:44:53 +05:30
2026-06-27 21:23:25 -07:00
2026-06-25 13:52:06 -07:00
2026-06-27 19:49:02 -07:00
2026-06-27 15:59:00 -07:00
2026-07-07 00:53:48 -07:00
2026-07-18 14:30:24 +05:30
2026-07-11 05:43:07 -07:00
2026-07-07 02:32:32 -07:00
2026-06-30 17:58:52 -05:00
2026-06-29 21:33:00 +10:00
2026-07-09 19:54:02 -07:00
2026-07-09 16:46:07 -07:00
2026-07-07 12:36:41 -07:00
2026-07-09 19:54:02 -07:00
2026-07-05 22:04:52 -07:00
2026-07-03 13:44:00 -07:00
2026-07-17 04:53:38 -07:00
2026-07-05 23:01:10 -07:00
2026-07-07 15:12:49 -07:00
2026-07-16 05:44:43 -07:00
2026-07-05 14:51:49 -07:00
2026-07-09 20:03:11 -07:00
2026-06-24 17:56:30 +05:30
2026-07-05 13:42:46 -07:00
2026-07-09 19:57:54 -07:00
2026-07-14 13:58:36 -07:00
2026-07-02 04:59:02 -07:00
2026-06-30 04:38:43 -07:00
2026-07-16 05:44:43 -07:00
2026-07-16 05:08:56 -07:00
2026-07-18 14:30:24 +05:30
2026-07-16 01:19:29 -07:00
2026-07-08 07:09:08 -07:00
2026-07-07 16:27:28 -07:00
2026-07-16 01:17:11 -07:00
2026-06-26 14:07:43 +05:30
2026-07-16 15:45:07 +00:00
2026-07-17 23:04:33 +00:00
2026-07-07 05:12:24 -07:00
2026-06-25 21:39:29 -06:00
2026-06-27 11:43:01 -07:00
2026-06-28 02:40:37 -07:00
2026-07-05 19:35:30 -07:00
2026-07-03 04:08:37 -07:00
2026-07-15 00:09:24 +05:30
2026-07-11 12:28:55 +05:30
2026-07-03 04:23:15 +05:30
2026-06-28 17:02:05 -05:00
2026-07-01 05:25:33 -07:00
2026-07-09 12:21:16 +05:30
2026-07-17 04:33:34 -07:00
2026-07-10 11:43:09 +05:30
2026-07-04 17:58:05 +05:30
2026-07-08 00:20:13 +00:00
2026-06-28 16:29:52 -05:00
2026-07-16 07:17:55 -07:00
2026-07-07 13:54:07 -07:00
2026-07-16 00:02:09 +05:30
2026-06-28 03:58:18 -07:00
2026-07-03 15:22:43 -05:00
2026-07-18 00:34:54 -04:00
2026-07-16 15:45:07 +00:00
2026-07-16 12:36:51 +05:30
2026-07-07 17:45:51 -07:00
2026-07-02 13:17:41 -07:00
2026-07-02 13:17:41 -07:00
2026-07-09 16:58:37 -07:00