Protect assistant uploads with Rewind exclusions#7191
Conversation
Greptile SummaryThis PR adds Rewind privacy exclusions to the proactive assistant pipeline: excluded apps are now blocked from frame tracking/distribution in
Confidence Score: 3/5The privacy gate itself is sound, but skipping The three assistant-settings changes are clean. The plugin change correctly blocks sensitive frames from reaching LLM paths, but desktop/Desktop/Sources/ProactiveAssistants/ProactiveAssistantsPlugin.swift and AssistantCoordinator.swift (not in this PR) both need attention: the former now conditionally calls Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Capture frame] --> B{isRewindExcluded?}
B -- Yes --> C[Skip trackFrame / distributeFrame / RewindIndexer]
B -- No --> D[AssistantCoordinator.trackFrame]
D --> E{isInDelayPeriod?}
E -- No --> F[distributeFrameIfChanged]
E -- Yes --> G[distributeFrameDuringDelay]
F --> H[Assistant.analyze]
G --> H
H --> I{isAppExcluded? Rewind or built-in or user}
I -- Yes --> J[Skip analysis]
I -- No --> K[Process frame / emit event]
B -- No --> L[RewindIndexer.processFrame]
|
| 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) | ||
| } | ||
| } |
There was a problem hiding this comment.
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.
Summary
Fixes #7098
Verification
cd ~/projects/omi/desktop/Desktop && swift build 2>&1 | tail -5