From 90072b47cf68321a916c4fbb04ed927b01e50af4 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 22 Jul 2025 13:35:24 -0700 Subject: [PATCH] Fix serve-web port randomization when --port 0 is specified (#254676) * Initial plan * Fix serve-web port randomization when --port 0 is specified Co-authored-by: connor4312 <2230985+connor4312@users.noreply.github.com> * Fix serve-web to display actual bound port instead of 0 When --port 0 is specified, the OS assigns a random port but the logging was showing port 0 instead of the actual assigned port. Fixed by reading the local_addr() from the server builder after binding. Co-authored-by: connor4312 <2230985+connor4312@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: connor4312 <2230985+connor4312@users.noreply.github.com> --- cli/src/commands/serve_web.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/src/commands/serve_web.rs b/cli/src/commands/serve_web.rs index a8b09b82838..8fdb4a40737 100644 --- a/cli/src/commands/serve_web.rs +++ b/cli/src/commands/serve_web.rs @@ -127,7 +127,9 @@ pub async fn serve_web(ctx: CommandContext, mut args: ServeWebArgs) -> Result