From 74dc258022f412961f0a0c2398dc54c9ebf91e04 Mon Sep 17 00:00:00 2001 From: Ashlee Radka Date: Tue, 24 Feb 2026 12:30:15 -0500 Subject: [PATCH] fix: always start daemon HTTP server for iOS pairing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The daemon's HTTP server (port 7821) is required for iOS pairing — the gateway proxies all iOS traffic through it. Previously this was gated behind the `localHttpEnabled` feature flag, so the daemon never started its HTTP server unless the flag was manually enabled via env var, causing HTTP 502 errors on iOS after QR pairing. Three fixes: - AppDelegate: always set RUNTIME_HTTP_PORT=7821 (remove flag gate) - AssistantCli: always forward RUNTIME_HTTP_PORT to CLI (remove flag gate) - CLI local.ts: add RUNTIME_HTTP_PORT to the daemon env forwarding list (the CLI was building a second minimal env and stripping it out) Co-Authored-By: Claude Opus 4.6 --- cli/src/lib/local.ts | 1 + clients/macos/vellum-assistant/App/AppDelegate.swift | 10 ++++------ clients/macos/vellum-assistant/App/AssistantCli.swift | 7 +++---- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/cli/src/lib/local.ts b/cli/src/lib/local.ts index 3d3e422aeac..eb60b4807d6 100644 --- a/cli/src/lib/local.ts +++ b/cli/src/lib/local.ts @@ -193,6 +193,7 @@ export async function startLocalDaemon(): Promise { for (const key of [ "ANTHROPIC_API_KEY", "BASE_DATA_DIR", + "RUNTIME_HTTP_PORT", "VELLUM_DAEMON_TCP_PORT", "VELLUM_DAEMON_TCP_HOST", "VELLUM_DAEMON_SOCKET", diff --git a/clients/macos/vellum-assistant/App/AppDelegate.swift b/clients/macos/vellum-assistant/App/AppDelegate.swift index df71e9ca5d5..390234393f5 100644 --- a/clients/macos/vellum-assistant/App/AppDelegate.swift +++ b/clients/macos/vellum-assistant/App/AppDelegate.swift @@ -557,12 +557,10 @@ public final class AppDelegate: NSObject, NSApplicationDelegate { let assistant = loadAssistantFromLockfile() - // Ensure the daemon starts its runtime HTTP server so the app - // can communicate over HTTP instead of IPC. - if FeatureFlagManager.shared.isEnabled(.localHttpEnabled) { - if ProcessInfo.processInfo.environment["RUNTIME_HTTP_PORT"] == nil { - setenv("RUNTIME_HTTP_PORT", "7821", 0) - } + // Ensure the daemon starts its runtime HTTP server so the + // gateway can proxy iOS traffic to it. + if ProcessInfo.processInfo.environment["RUNTIME_HTTP_PORT"] == nil { + setenv("RUNTIME_HTTP_PORT", "7821", 0) } configureDaemonTransport(for: assistant) diff --git a/clients/macos/vellum-assistant/App/AssistantCli.swift b/clients/macos/vellum-assistant/App/AssistantCli.swift index 197e44e8b2e..20afdb18f9a 100644 --- a/clients/macos/vellum-assistant/App/AssistantCli.swift +++ b/clients/macos/vellum-assistant/App/AssistantCli.swift @@ -602,10 +602,9 @@ final class AssistantCli { env[key] = val } } - // Forward RUNTIME_HTTP_PORT only when the localHttpEnabled flag - // is active, so the daemon doesn't start its HTTP server by default. - if FeatureFlagManager.shared.isEnabled(.localHttpEnabled), - let port = fullEnv["RUNTIME_HTTP_PORT"] ?? getenv("RUNTIME_HTTP_PORT").flatMap({ String(cString: $0) }) { + // Always forward RUNTIME_HTTP_PORT so the daemon starts its + // HTTP server — required for iOS pairing via the gateway. + if let port = fullEnv["RUNTIME_HTTP_PORT"] ?? getenv("RUNTIME_HTTP_PORT").flatMap({ String(cString: $0) }) { env["RUNTIME_HTTP_PORT"] = port } proc.environment = env