From 5d29985c4f9bb44be35ca544391d3f9df952c689 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 4 Jan 2026 16:27:17 +0100 Subject: [PATCH] fix: avoid sendable issue in mac location timeout --- .../Clawdbot/NodeMode/MacNodeLocationService.swift | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/macos/Sources/Clawdbot/NodeMode/MacNodeLocationService.swift b/apps/macos/Sources/Clawdbot/NodeMode/MacNodeLocationService.swift index 2124ba720..c88faf8b8 100644 --- a/apps/macos/Sources/Clawdbot/NodeMode/MacNodeLocationService.swift +++ b/apps/macos/Sources/Clawdbot/NodeMode/MacNodeLocationService.swift @@ -11,6 +11,9 @@ final class MacNodeLocationService: NSObject, CLLocationManagerDelegate { private let manager = CLLocationManager() private var locationContinuation: CheckedContinuation? + private struct UncheckedSendable: @unchecked Sendable { + let value: T + } override init() { super.init() @@ -68,15 +71,15 @@ final class MacNodeLocationService: NSObject, CLLocationManagerDelegate { return try await operation() } - return try await withThrowingTaskGroup(of: T.self) { group in - group.addTask { try await operation() } + return try await withThrowingTaskGroup(of: UncheckedSendable.self) { group in + group.addTask { try await UncheckedSendable(value: operation()) } group.addTask { try await Task.sleep(nanoseconds: UInt64(timeoutMs) * 1_000_000) throw Error.timeout } let result = try await group.next()! group.cancelAll() - return result + return result.value } }