Clean test VM: click Open on the download prompt over VNC, like a user - #1823
Merged
Merged
Conversation
Run 4 reached a clear desktop, but the "downloaded from the Internet" prompt stayed on screen: clearing the quarantine flag doesn't close a prompt that's already showing, and launching again only brought it forward, so Transcripted never started. - vnc.py `click-default-button [--dry-run]` finds the blue default button on screen (a solid pill of the accent blue above the Dock) and clicks it. It found Open at the right spot in all run 4 screenshots and nothing in the five other real screenshots (desktop with Dock icons, the blue Setup Assistant screen). - approve-download: after the Gatekeeper check, click Open over VNC (twice, since a first click may only bring the prompt forward), then press Return (Open is the default button), waiting for the Transcripted process each time. Clearing the quarantine flag is now only the fallback, and it says so. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011CFGqqwpKNjdBifQbmEMsS
Review fixes for the approve-download flow: - Read the guest's window list (CGWindowList via osascript, no Accessibility grant) and only click a blue default button inside the CoreServicesUIAgent prompt window. Press Return only while that prompt is the front window. No readable window list means no clicks at all. - Check whether Transcripted already started before every retry, so a slow start never gets a second click. - The quarantine-clearing fallback exits 3; first-run reports that step as "ok via bypass" and the summary never says all steps ok after it. - vnc.py: keysyms above 0xFFFFFFFF are refused, and serve treats a struct packing error as a failed command instead of dying. - Guard tests for all of the above against a fake guest. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011CFGqqwpKNjdBifQbmEMsS
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.
Before: in run 4 on Justin's Mac, the Setup Assistant fix (#1822) worked, the desktop came up clear, and the single VNC connection held. But Transcripted never started. The "downloaded from the Internet… Are you sure you want to open it?" prompt stayed on screen for the whole run.
approve-downloadcleared the quarantine flag, but that doesn't close a prompt that's already showing, and the second launch only brought the prompt forward. Soapp_launchedtimed out.After:
approve-downloadclicks the prompt's Open button over the VNC session (the virtual mouse), which is what a real user does. Every click lands inside the prompt's own window, read from the guest each time. Return is pressed only while that prompt is the front window. Before each retry it checks whether the app has already started. Clearing the quarantine flag is only a last resort. It exits 3, so first-run reports that step as "ok via bypass" and the summary never says "all steps ok" after it.How:
vnc.py click-default-button [--dry-run] [--within X,Y,W,H --points-wide N]takes a screenshot over the existing session and finds the blue default button. It looks for a solid, pill-shaped patch of macOS's accent blue above the Dock, with limits on size, aspect ratio and fill. With--within, it only takes a button whose centre is inside that window, with the box scaled from screen points to framebuffer pixels.approve-download:spctl --assesscheck first, as before.osascript -l JavaScriptandCGWindowListCopyWindowInfo. That gives window owners and bounds only, so no Accessibility or Screen Recording grant is needed. It finds the CoreServicesUIAgent prompt window and which window is in front.Transcriptedprocess.vnc.pyrefuses keysyms above 0xFFFFFFFF.servetreats a struct packing error as a failed command instead of dying (N1 from Clean test VM: one VNC connection per boot, VNC off by default #1820's post-merge check).approve-downloadis gone.Tests:
find_default_buttonagainst the real screenshots from runs 1–4:vnc.py --self-testcovers:--withinchoosing the prompt's button over a bigger one elsewhere, and returning none outside itserve, which fails the request while the session stays uptest-transcripted-vm.shis at 58/58, with new fake-guest cases:supervise.py --self-test,shellcheck -S warning,scripts/dev/linux-checks.sh(49/49) andcheck-source-pins.py --changed-onlyall pass.Run 5 will show whether the window list reads the same way on macOS 26 and whether the click starts the app. The report says which path it took. No
.github/workflowschanges.🤖 Generated with Claude Code
https://claude.ai/code/session_011CFGqqwpKNjdBifQbmEMsS
Generated by Claude Code