From 301a0fbc9160c7c0b14909dc070a300a2b98ef81 Mon Sep 17 00:00:00 2001 From: Quinn Ftw Date: Sun, 28 Dec 2025 21:19:50 -0800 Subject: [PATCH] fix(conversation-assistant): fix Swift compilation errors in APIClient MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace force unwrap on non-optional deviceId with if-let pattern - Remove unused uuidBytes variable declaration 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../macos/Sources/Services/APIClient.swift | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/features/conversation-assistant/macos/Sources/Services/APIClient.swift b/features/conversation-assistant/macos/Sources/Services/APIClient.swift index 35d7df90b..82aa0aea8 100644 --- a/features/conversation-assistant/macos/Sources/Services/APIClient.swift +++ b/features/conversation-assistant/macos/Sources/Services/APIClient.swift @@ -56,14 +56,18 @@ class APIClient { } func verifyDevice(code: String) async throws { - guard let deviceId = deviceId else { + let currentDeviceId: String + if let existingId = deviceId { + currentDeviceId = existingId + } else { // Register first if no device ID let (newId, _) = try await registerDevice() self.deviceId = newId + currentDeviceId = newId } let params: [String: String] = [ - "deviceId": deviceId!, + "deviceId": currentDeviceId, "code": code ] @@ -118,7 +122,6 @@ class APIClient { IOServiceMatching("IOPlatformExpertDevice") ) - var uuidBytes: Unmanaged? let result = IORegistryEntryCreateCFProperty( service, "IOPlatformUUID" as CFString,