From 136bcb096b80ab7e051b01054597b16cd836866c Mon Sep 17 00:00:00 2001 From: Lawrence Chen <54008264+lawrencecchen@users.noreply.github.com> Date: Wed, 26 Aug 2026 00:08:11 -0700 Subject: [PATCH 1/3] fix(cli): add explicit encode(to:) for PendingCursorShellApproval #9349 added a decode-only legacyCommand CodingKey plus a custom init(from:), which kills Encodable synthesis: the cmux-cli target fails to compile on main (error: CodingKey case 'legacyCommand' does not match any stored properties). Encode the stored fields explicitly and never emit the legacy key. --- CLI/cmux.swift | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CLI/cmux.swift b/CLI/cmux.swift index 3df8ba654243..3f6a9f222f55 100644 --- a/CLI/cmux.swift +++ b/CLI/cmux.swift @@ -249,6 +249,19 @@ struct ClaudeHookSessionRecord: Codable { createdAt = try container.decodeIfPresent(TimeInterval.self, forKey: .createdAt) ?? 0 requiresToolUseId = try container.decodeIfPresent(Bool.self, forKey: .requiresToolUseId) ?? false } + + /// `legacyCommand` exists only for decoding pre-fingerprint records, + /// so Encodable cannot be synthesized; encode the stored fields only. + func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(commandFingerprint, forKey: .commandFingerprint) + try container.encode(commandLength, forKey: .commandLength) + try container.encode(displayCommand, forKey: .displayCommand) + try container.encodeIfPresent(toolUseId, forKey: .toolUseId) + try container.encodeIfPresent(notificationCorrelationKey, forKey: .notificationCorrelationKey) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(requiresToolUseId, forKey: .requiresToolUseId) + } } var sessionId: String From 32f4c3ed16d6dd29873e5214362d82c7602d070c Mon Sep 17 00:00:00 2001 From: Lawrence Chen <54008264+lawrencecchen@users.noreply.github.com> Date: Wed, 26 Aug 2026 00:40:01 -0700 Subject: [PATCH 2/3] fix(cli): rename shadowed projectRoot rebinding Same-scope 'let projectRoot = projectRoot ?? cwdURL' after 'var projectRoot: URL?' is an invalid redeclaration and breaks the build; bind the resolved root under a new name. --- CLI/cmux.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CLI/cmux.swift b/CLI/cmux.swift index 3f6a9f222f55..52eb253234ae 100644 --- a/CLI/cmux.swift +++ b/CLI/cmux.swift @@ -33113,15 +33113,15 @@ export default CMUXSessionRestore; cursor = parent ancestorDepth += 1 } - let projectRoot = projectRoot ?? cwdURL + let resolvedProjectRoot = projectRoot ?? cwdURL applyConfig( - at: projectRoot + at: resolvedProjectRoot .appendingPathComponent(".cursor", isDirectory: true) .appendingPathComponent("cli.json", isDirectory: false), readsApprovalMode: false ) - if cwdURL.path != projectRoot.path, - cwdURL.path.hasPrefix(projectRoot.path + "/") { + if cwdURL.path != resolvedProjectRoot.path, + cwdURL.path.hasPrefix(resolvedProjectRoot.path + "/") { // Keep the hook's synchronous policy lookup bounded: the // global file, repository root, and current project directory // cover the supported effective layers without walking every From f628caefad01c0c417a07dcda1e58ef6e9c48513 Mon Sep 17 00:00:00 2001 From: Lawrence Chen <54008264+lawrencecchen@users.noreply.github.com> Date: Wed, 26 Aug 2026 00:51:04 -0700 Subject: [PATCH 3/3] fix: annotate compactMap result types broken by #9349 TerminalNotificationPolicyInFlightStore's guarded dictionary compactMap fails ElementOfResult inference on the fleet toolchain; annotate it and the sibling guarded closure in TerminalNotificationStore explicitly. --- Sources/TerminalNotificationPolicyInFlightStore.swift | 2 +- Sources/TerminalNotificationStore.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/TerminalNotificationPolicyInFlightStore.swift b/Sources/TerminalNotificationPolicyInFlightStore.swift index 2af651e14e1c..6f525be548a9 100644 --- a/Sources/TerminalNotificationPolicyInFlightStore.swift +++ b/Sources/TerminalNotificationPolicyInFlightStore.swift @@ -146,7 +146,7 @@ final class TerminalNotificationPolicyInFlightStore { correlationKey: String, through generation: UInt64? = nil ) { - let idsToDiscard = requests.compactMap { id, entry in + let idsToDiscard = requests.compactMap { id, entry -> UUID? in guard generation.map({ entry.generation <= $0 }) ?? true, entry.request.correlationKey == correlationKey, Self.matchesSurfaceAlias(entry.request, surfaceId: surfaceId) else { diff --git a/Sources/TerminalNotificationStore.swift b/Sources/TerminalNotificationStore.swift index 0ec57760696e..d409d02c17d6 100644 --- a/Sources/TerminalNotificationStore.swift +++ b/Sources/TerminalNotificationStore.swift @@ -1973,7 +1973,7 @@ final class TerminalNotificationStore: ObservableObject { ) let liveTabId = AppDelegate.shared? .agentNotificationDeliveryTarget(claimedTabId: tabId, surfaceId: surfaceId)?.tabId ?? tabId - let ids = notifications.compactMap { notification in + let ids = notifications.compactMap { notification -> UUID? in guard notification.correlationKey == correlationKey, notification.matchesClear( tabId: tabId,