From 45398b76609696205044743752ddd28ee016e688 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 7 Dec 2025 16:33:56 +0100 Subject: [PATCH] voice wake: use clean PATH (no inherited junk) --- apps/macos/Sources/Clawdis/VoiceWakeForwarder.swift | 3 ++- apps/macos/Tests/ClawdisIPCTests/VoiceWakeForwarderTests.swift | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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")) }