From eff0105c040945e098fc85e19659518bc33b70f8 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Fri, 12 Dec 2025 12:53:20 -0500 Subject: [PATCH] Add a comment explaining port behavior --- crates/extension_host/src/wasm_host/wit/since_v0_8_0.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/extension_host/src/wasm_host/wit/since_v0_8_0.rs b/crates/extension_host/src/wasm_host/wit/since_v0_8_0.rs index 4954f46da51bd1a354c97eae0e2cffc266d02a1e..c1d819b7768ed895ec098f04682bb4f833c763c1 100644 --- a/crates/extension_host/src/wasm_host/wit/since_v0_8_0.rs +++ b/crates/extension_host/src/wasm_host/wit/since_v0_8_0.rs @@ -1280,6 +1280,8 @@ impl llm_provider::Host for WasmState { self.on_main_thread(move |cx| { async move { + // Bind to port 0 to let the OS assign an available port, then substitute + // it into the auth URL's {port} placeholder for the OAuth callback. let listener = TcpListener::bind("127.0.0.1:0") .await .map_err(|e| anyhow::anyhow!("Failed to bind localhost server: {}", e))?;