From 9bf5b92d8f9744174e1fa393615aedc92b369d1b Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 20 Dec 2025 15:05:57 +0100 Subject: [PATCH] fix: clarify remote gateway error --- apps/macos/Sources/Clawdis/ControlChannel.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/macos/Sources/Clawdis/ControlChannel.swift b/apps/macos/Sources/Clawdis/ControlChannel.swift index 1e210fa5d..5312fa641 100644 --- a/apps/macos/Sources/Clawdis/ControlChannel.swift +++ b/apps/macos/Sources/Clawdis/ControlChannel.swift @@ -185,12 +185,19 @@ final class ControlChannel { case .cancelled: return "Gateway connection was closed; start the gateway (localhost:\(port)) and retry." case .cannotFindHost, .cannotConnectToHost: - if AppStateStore.attachExistingGatewayOnly { + let isRemote = CommandResolver.connectionModeIsRemote() + if AppStateStore.attachExistingGatewayOnly, !isRemote { return """ Cannot reach gateway at localhost:\(port) and “Attach existing gateway only” is enabled. Disable it in Debug Settings or start a gateway on that port. """ } + if isRemote { + return """ + Cannot reach gateway at localhost:\(port). + Remote mode uses an SSH tunnel—check the SSH target and that the tunnel is running. + """ + } return "Cannot reach gateway at localhost:\(port); ensure the gateway is running." case .networkConnectionLost: return "Gateway connection dropped; gateway likely restarted—retry."