From 221c0b4cf8410261e5424dde4cbf7de88805a4bd Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 12 Jan 2026 03:34:24 +0000 Subject: [PATCH] fix: tighten gateway listener detection --- apps/macos/Sources/Clawdbot/PortGuardian.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/macos/Sources/Clawdbot/PortGuardian.swift b/apps/macos/Sources/Clawdbot/PortGuardian.swift index f8bcdd73e..b0f03fa28 100644 --- a/apps/macos/Sources/Clawdbot/PortGuardian.swift +++ b/apps/macos/Sources/Clawdbot/PortGuardian.swift @@ -344,14 +344,17 @@ actor PortGuardian { private func isExpected(_ listener: Listener, port: Int, mode: AppState.ConnectionMode) -> Bool { let cmd = listener.command.lowercased() - let expectedCommands = ["node", "clawdbot", "tsx", "pnpm", "bun"] + let full = listener.fullCommand.lowercased() switch mode { case .remote: // Remote mode expects an SSH tunnel for the gateway WebSocket port. if port == GatewayEnvironment.gatewayPort() { return cmd.contains("ssh") } return false case .local: - return expectedCommands.contains { cmd.contains($0) } + if !cmd.contains("clawdbot") { return false } + if full.contains("gateway-daemon") { return true } + // If args are unavailable, treat a clawdbot listener as expected. + return full == cmd case .unconfigured: return false }