Add a comment explaining port behavior

Richard Feldman created

Change summary

crates/extension_host/src/wasm_host/wit/since_v0_8_0.rs | 2 ++
1 file changed, 2 insertions(+)

Detailed changes

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))?;