Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,11 @@ class FocusAssistantSettings {
}
}

/// Check if an app is excluded (built-in or user-added)
/// Check if an app is excluded (Rewind privacy, built-in, or user-added)
func isAppExcluded(_ appName: String) -> Bool {
TaskAssistantSettings.builtInExcludedApps.contains(appName) || excludedApps.contains(appName)
RewindSettings.shared.isAppExcluded(appName)
|| TaskAssistantSettings.builtInExcludedApps.contains(appName)
|| excludedApps.contains(appName)
}

/// Add an app to the exclusion list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,11 @@ class InsightAssistantSettings {
}
}

/// Check if an app is excluded from insight extraction (built-in list + user's custom list)
/// Check if an app is excluded from insight extraction (Rewind privacy, built-in list, or user's custom list)
func isAppExcluded(_ appName: String) -> Bool {
TaskAssistantSettings.builtInExcludedApps.contains(appName) || excludedApps.contains(appName)
RewindSettings.shared.isAppExcluded(appName)
|| TaskAssistantSettings.builtInExcludedApps.contains(appName)
|| excludedApps.contains(appName)
}

/// Add an app to the insight extraction exclusion list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,11 @@ class MemoryAssistantSettings {
}
}

/// Check if an app is excluded from memory extraction (built-in list + user's custom list)
/// Check if an app is excluded from memory extraction (Rewind privacy, built-in list, or user's custom list)
func isAppExcluded(_ appName: String) -> Bool {
TaskAssistantSettings.builtInExcludedApps.contains(appName) || excludedApps.contains(appName)
RewindSettings.shared.isAppExcluded(appName)
|| TaskAssistantSettings.builtInExcludedApps.contains(appName)
|| excludedApps.contains(appName)
}

/// Add an app to the memory extraction exclusion list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -788,14 +788,16 @@ public class ProactiveAssistantsPlugin: NSObject {
captureTime: captureTime
)

// Always track the frame for context switch detection (even during delay)
AssistantCoordinator.shared.trackFrame(frame)

if !isInDelayPeriod {
distributeFrameIfChanged(frame)
} else {
// During delay, still distribute to assistants that need it (e.g. refocus detection)
AssistantCoordinator.shared.distributeFrameDuringDelay(frame)
if !isRewindExcluded {
// Track and distribute only frames that pass the shared screen privacy gate.
AssistantCoordinator.shared.trackFrame(frame)

if !isInDelayPeriod {
distributeFrameIfChanged(frame)
} else {
// During delay, still distribute to assistants that need it (e.g. refocus detection)
AssistantCoordinator.shared.distributeFrameDuringDelay(frame)
}
}
Comment on lines +791 to 801
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Stale departingFrame when leaving an excluded app

checkContextSwitch is called unconditionally (line 706) and reads lastTrackedFrame as the departing frame before calling trackFrame. Because trackFrame is now gated on !isRewindExcluded, lastTrackedFrame is never updated while the user is in an excluded app. When the user later switches away from that excluded app, onContextSwitch fires with a departingFrame holding a frame from before they entered the excluded app — potentially minutes stale. Assistants that rely on departingFrame to represent "what the user was just doing" (e.g. memory/focus extraction on context leave) will act on incorrect data. The intent in the comment at line 704 ("departing frame is from the previous context") is broken for excluded apps. Clearing lastTrackedFrame to nil inside AssistantCoordinator when the excluded gate is hit, or passing nil explicitly when isRewindExcluded, would fix this.

}

Expand Down Expand Up @@ -856,14 +858,16 @@ public class ProactiveAssistantsPlugin: NSObject {
frameNumber: frameCount
)

// Always track the frame for context switch detection (even during delay)
AssistantCoordinator.shared.trackFrame(frame)
if !isRewindExcluded {
// Track and distribute only frames that pass the shared screen privacy gate.
AssistantCoordinator.shared.trackFrame(frame)

if !isInDelayPeriod {
distributeFrameIfChanged(frame)
} else {
// During delay, still distribute to assistants that need it (e.g. refocus detection)
AssistantCoordinator.shared.distributeFrameDuringDelay(frame)
if !isInDelayPeriod {
distributeFrameIfChanged(frame)
} else {
// During delay, still distribute to assistants that need it (e.g. refocus detection)
AssistantCoordinator.shared.distributeFrameDuringDelay(frame)
}
}

if !isRewindExcluded {
Expand Down
Loading