Repository navigation
fix(mcp): record the window an in-app take names, even where Apple's picker owns sources - #1237
Conversation
…picker owns sources On macOS 15.2+ the in-app startRecording cleared the source and left the choice to Apple's picker, which waits for a person: the call timed out after 120 s and left the picker on screen. A named take now records its window or display directly, as the stdio server and the legacy picker do, and is refused with a clear message when Screen Recording is denied. Fixes #1232.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Fixes #1232.
On macOS 15.2 or later, with a default launch,
pointHudAtTakecleared the selected source for an in-app MCP take so that Apple's picker would ask which window or display to record. An MCP client is not there to answer:startRecordingwithwindowwaited 120 s, failed with "capture had not started", and left the picker on screen, even after OpenScreen quit (measured on 2026-10-14, build run 38615516865).A named take now records what it names in that case too. It goes through the same enumeration and
selectSourcepath as everywhere else, the path the CLI'srecordalready uses in picker mode. A non-picker source makes the capture spawn its own helper (isMacPickerSourceIdis false), so no picker opens. That path needs the Screen Recording grant, which the picker otherwise makes unnecessary. It is read fresh withreadMacScreenCaptureAccess(). A Mac that refused it gets an error naming the System Settings pane instead of a picker. A probe that could not answer (no helper, a crash, a timeout) is not taken for a refusal (electron/mcp/macNamedTake.ts, unit-tested). The in-appstartRecordingdescription now says what happens on macOS and on Linux, where the portal still asks.Because the picker is never opened for an MCP take, it can no longer be left on screen after a timeout either.
Checks:
npx vitest --run electron/mcp(151 tests),npx tsc --noEmit,npx tsc -p tsconfig.test.json --noEmitand Biome pass. Not yet run in a packaged build: the end-to-end check is an in-appstartRecordingon a window from a default (non-legacy) launch on macOS 15.2+.Summary by CodeRabbit