Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions CLI/cmux.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -33100,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
Expand Down
2 changes: 1 addition & 1 deletion Sources/TerminalNotificationPolicyInFlightStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion Sources/TerminalNotificationStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down