From 2f8745bc1f54f12caa773e716a03e71b6b44bec0 Mon Sep 17 00:00:00 2001 From: Tam Nhu Tran Date: Tue, 9 Jun 2026 20:08:07 -0400 Subject: [PATCH] fix(bar): bind 'ccs bar launch' server to IPv4 loopback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit startServer was called without a host, defaulting to 'localhost' which resolves to ::1 (IPv6) on macOS, while bar.json's baseUrl and the menu-bar app use 127.0.0.1 — so the app could not reach its own server (connection refused) and showed offline. Pass host 127.0.0.1 explicitly to match. --- src/commands/bar/launch-subcommand.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/commands/bar/launch-subcommand.ts b/src/commands/bar/launch-subcommand.ts index 89cc33ef..8476c753 100644 --- a/src/commands/bar/launch-subcommand.ts +++ b/src/commands/bar/launch-subcommand.ts @@ -72,7 +72,10 @@ async function defaultEnsureDashboard(): Promise { const { startServer } = await import('../../web-server'); const port = await getPort({ port: [3000, 3001, 3002, 8000, 8080] }); - const { server } = await startServer({ port }); + // Bind IPv4 loopback explicitly. Without a host, startServer defaults to + // 'localhost', which on macOS resolves to ::1 (IPv6) — but bar.json's baseUrl + // (and the Swift app) use 127.0.0.1, so the app could not reach its own server. + const { server } = await startServer({ port, host: '127.0.0.1' }); const addr = server.address(); const resolvedPort = addr && typeof addr === 'object' ? addr.port : port;