From fee2ec41fad34b6250fda36d10b8f1c240f69404 Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Mon, 9 Mar 2026 16:46:50 -0700 Subject: [PATCH] Move inputParser inside task scope to avoid races. --- Sources/SecretAgent/AppDelegate.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/SecretAgent/AppDelegate.swift b/Sources/SecretAgent/AppDelegate.swift index 49c109a..40a11a3 100644 --- a/Sources/SecretAgent/AppDelegate.swift +++ b/Sources/SecretAgent/AppDelegate.swift @@ -35,9 +35,9 @@ class AppDelegate: NSObject, NSApplicationDelegate { func applicationDidFinishLaunching(_ aNotification: Notification) { logger.debug("SecretAgent finished launching") Task { - let inputParser = try await XPCAgentInputParser() for await session in socketController.sessions { Task { + let inputParser = try await XPCAgentInputParser() do { for await message in session.messages { let request = try await inputParser.parse(data: message)