Repository navigation
fix(preview): stop repeated macos screen capture consent alerts - #1463
Merged
Merged
Conversation
macOS checks direct-capture consent only after a frame, by resolving the
process that captured it. The window preview killed its capture helper
right after a frame when the target changed or the preview stopped, so
replayd failed to resolve it ("Error resolving binary path and audit
token"), showed the consent alert again and kept no answer.
Stopping the preview now ends the helper's input. The helper finishes the
outstanding frame and exits one second after its last one; SIGKILL is
only a fallback after 4 s. Callers no longer wait for the helper to exit.
Fixes: #1284
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
During Desktop automation macOS kept showing "Canopy is requesting to bypass the system private window picker…" although the user had allowed it many times. The
replaydapproval forapp.canopy.desktopstayed in place (kScreenCaptureApprovalLastAlertedunchanged for weeks), so the answers were never stored.The
replaydlog shows why. macOS checks consent after each frame by resolving the capturing process. Every alert came right after the window preview's capture helper disconnected:The preview killed the helper with
SIGKILLright after a frame when the target changed or the preview stopped (desktop-follow-preview.ts).replaydcould no longer resolve the process, so it showed the alert and had nothing to store the answer for.Fix
SIGKILLstays as a fallback after 4 s (the helper bounds one capture at 2.5 s).next()returns as soon as the capture stops and no longer waits for an outstanding frame. The failure path in the follow preview no longer waits for the helper to exit before falling back to Agent Desktop screenshots; the preview'sclose()still awaits it.docs/automation-tools.mddescribes the behaviour.Fixes: #1284
Verification
bun run check:tmp ./apps/worker/src/agent-preview/desktop-follow.test.ts(6 pass).log stream --info --predicate 'process == "replayd"'running while the agent switches windows.Error resolving binary path and audit tokenand the alert should no longer appear.replayd, and the existing follow tests cover the preview wiring on Linux.🤖 Generated with Claude Code