diff --git a/apps/macos/Sources/OpenClaw/AppState.swift b/apps/macos/Sources/OpenClaw/AppState.swift index e971ac3f3fb..4e4048e72a5 100644 --- a/apps/macos/Sources/OpenClaw/AppState.swift +++ b/apps/macos/Sources/OpenClaw/AppState.swift @@ -380,10 +380,10 @@ final class AppState { { self.remoteTarget = configRemoteTarget } else if resolvedConnectionMode == .remote, - configRemoteTransport != .direct, - storedRemoteTarget.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty, - let host = AppState.remoteHost(from: configRemoteUrl), - !LoopbackHost.isLoopbackHost(host) + configRemoteTransport != .direct, + storedRemoteTarget.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty, + let host = AppState.remoteHost(from: configRemoteUrl), + !LoopbackHost.isLoopbackHost(host) { self.remoteTarget = "\(NSUserName())@\(host)" } else { diff --git a/apps/macos/Sources/OpenClaw/DashboardWindowController.swift b/apps/macos/Sources/OpenClaw/DashboardWindowController.swift index f27f37ce53f..76330cbb562 100644 --- a/apps/macos/Sources/OpenClaw/DashboardWindowController.swift +++ b/apps/macos/Sources/OpenClaw/DashboardWindowController.swift @@ -3,11 +3,15 @@ import Foundation import WebKit private final class DashboardWindowContentView: NSView { - override var mouseDownCanMoveWindow: Bool { true } + override var mouseDownCanMoveWindow: Bool { + true + } } private final class DashboardWindowDragRegionView: NSView { - override var mouseDownCanMoveWindow: Bool { true } + override var mouseDownCanMoveWindow: Bool { + true + } override func mouseDown(with event: NSEvent) { self.window?.performDrag(with: event) @@ -275,7 +279,7 @@ final class DashboardWindowController: NSWindowController, WKNavigationDelegate, private func showLoadFailure(_ error: Error) { let nsError = error as NSError - if nsError.domain == NSURLErrorDomain && nsError.code == NSURLErrorCancelled { return } + if nsError.domain == NSURLErrorDomain, nsError.code == NSURLErrorCancelled { return } dashboardWindowLogger.error( "dashboard load failed url=\(self.currentURL.absoluteString, privacy: .public) error=\(error.localizedDescription, privacy: .public)") let html = Self.failureHTML(url: self.currentURL, message: error.localizedDescription) @@ -324,8 +328,8 @@ final class DashboardWindowController: NSWindowController, WKNavigationDelegate,

Dashboard unavailable

-

\(Self.htmlEscape(message))

- \(Self.htmlEscape(url.absoluteString)) +

\(self.htmlEscape(message))

+ \(self.htmlEscape(url.absoluteString))
diff --git a/apps/macos/Sources/OpenClaw/RemoteTunnelManager.swift b/apps/macos/Sources/OpenClaw/RemoteTunnelManager.swift index 9a3e8b91ed0..4448c4dc4c3 100644 --- a/apps/macos/Sources/OpenClaw/RemoteTunnelManager.swift +++ b/apps/macos/Sources/OpenClaw/RemoteTunnelManager.swift @@ -55,7 +55,10 @@ actor RemoteTunnelManager { if let create = self.createInFlight { self.logger.info("control tunnel create in flight; joining") let tunnel = try await create.task.value - return try await self.installCreatedTunnel(tunnel, token: create.token, fallbackPort: UInt16(GatewayEnvironment.gatewayPort())) + return try await self.installCreatedTunnel( + tunnel, + token: create.token, + fallbackPort: UInt16(GatewayEnvironment.gatewayPort())) } await self.waitForRestartBackoffIfNeeded() @@ -80,7 +83,11 @@ actor RemoteTunnelManager { return try await self.installCreatedTunnel(tunnel, token: token, fallbackPort: desiredPort) } - private func installCreatedTunnel(_ tunnel: RemotePortTunnel, token: UUID, fallbackPort: UInt16) async throws -> UInt16 { + private func installCreatedTunnel( + _ tunnel: RemotePortTunnel, + token: UUID, + fallbackPort: UInt16) async throws -> UInt16 + { if self.createInFlight?.token == token { self.createInFlight = nil } diff --git a/apps/macos/Sources/OpenClawMacCLI/ConfigureRemoteCommand.swift b/apps/macos/Sources/OpenClawMacCLI/ConfigureRemoteCommand.swift index 844b46e2a1d..4fba2f96a22 100644 --- a/apps/macos/Sources/OpenClawMacCLI/ConfigureRemoteCommand.swift +++ b/apps/macos/Sources/OpenClawMacCLI/ConfigureRemoteCommand.swift @@ -161,12 +161,17 @@ private func configureSSHRemote(_ opts: ConfigureRemoteOptions) throws -> Config onboardingSkipped: true) } -private func configureDirectRemote(_ opts: ConfigureRemoteOptions, directUrlRaw: String) throws -> ConfigureRemoteOutput { +private func configureDirectRemote( + _ opts: ConfigureRemoteOptions, + directUrlRaw: String) throws -> ConfigureRemoteOutput +{ guard let directURL = normalizeDirectURL(directUrlRaw) else { throw NSError( domain: "ConfigureRemote", code: 2, - userInfo: [NSLocalizedDescriptionKey: "Direct URL must be ws:// for private/Tailscale hosts or wss:// for remote hosts"]) + userInfo: [ + NSLocalizedDescriptionKey: "Direct URL must be ws:// for private/Tailscale hosts or wss:// for remote hosts", + ]) } let configURL = openClawConfigURL() @@ -212,7 +217,7 @@ private func openClawConfigURL() -> URL { private func loadConfigRoot(from url: URL) throws -> [String: Any] { guard FileManager().isReadableFile(atPath: url.path) else { return [:] } let data = try Data(contentsOf: url) - return (try JSONSerialization.jsonObject(with: data) as? [String: Any]) ?? [:] + return try (JSONSerialization.jsonObject(with: data) as? [String: Any]) ?? [:] } private func saveConfigRoot(_ root: [String: Any], to url: URL) throws {