diff --git a/apps/macos/Sources/Clawdis/VoiceWakeForwarder.swift b/apps/macos/Sources/Clawdis/VoiceWakeForwarder.swift index 237b0ba8f..85ff222c2 100644 --- a/apps/macos/Sources/Clawdis/VoiceWakeForwarder.swift +++ b/apps/macos/Sources/Clawdis/VoiceWakeForwarder.swift @@ -34,7 +34,8 @@ enum VoiceWakeForwarder { private static func cliLookupPrefix(target: String, echoPath: Bool) -> String { let normalizedTarget = target.trimmingCharacters(in: .whitespacesAndNewlines) - let pathPrefix = "PATH=\(cliHelperSearchPaths.joined(separator: ":")):$PATH" + // Use a clean, deterministic PATH so remote shells with spaces or odd entries don't break. + let pathPrefix = "PATH=\(cliHelperSearchPaths.joined(separator: ":"))" let searchList = self.cliSearchCandidates.joined(separator: " ") var steps: [String] = [pathPrefix] diff --git a/apps/macos/Tests/ClawdisIPCTests/VoiceWakeForwarderTests.swift b/apps/macos/Tests/ClawdisIPCTests/VoiceWakeForwarderTests.swift index c95012c0f..911378f45 100644 --- a/apps/macos/Tests/ClawdisIPCTests/VoiceWakeForwarderTests.swift +++ b/apps/macos/Tests/ClawdisIPCTests/VoiceWakeForwarderTests.swift @@ -32,7 +32,7 @@ import Testing @Test func commandPrefersCliInstallPaths() { let command = VoiceWakeForwarder.commandWithCliPath("clawdis-mac status", target: "user@host") - #expect(command.contains("PATH=\(cliHelperSearchPaths.joined(separator: ":")):$PATH")) + #expect(command.contains("PATH=\(cliHelperSearchPaths.joined(separator: ":"))")) #expect(command.contains("for c in clawdis-mac /usr/local/bin/clawdis-mac /opt/homebrew/bin/clawdis-mac")) #expect(command.contains("\"$CLI\" status")) }