Repository navigation
macOS engine: name a window off screen or on another Space, answer an app there at once, and refuse a Raise that cannot reach it (#367) - #401
Merged
Conversation
…s observation, and getScreenshot gives the reason (refs #367) The macOS engine reads the primary window's placement (Placement.swift). It is off screen when its AX frame overlaps no screen frame. It is on another Space when it lies on a display but its CGWindow has no kCGWindowIsOnscreen and its app is not hidden. Such a window is not captured, as a minimized window is not (screenshotOmitted "windowOffScreen" | "windowOnAnotherSpace"). Its Skyshot window carries `placement`, which the renderer prints as one line after the tree, the no-change diff included. The service adds `screenshotUnavailable`, and the facade's getScreenshot error appends it. A window on screen is observed byte for byte as before, pinned in the service test. A window on another Space used to fail its whole observation with noCapturableWindow and now succeeds with the line. Every other noCapturableWindow cause is unchanged (PlacementTests). The remedy names Raise with cua's host rule. The truncation paragraph of agent-cursor.md gains one sentence (surface inventory, PROVENANCE row). Decision Log entry #367. Sminos-Session: cursor235#b93055dd (cua on macbook)
…t, AXMinimized or AXHidden (refs #367) The review of 8355f1d found that the another-Space branch ran without the geometry guard. With no frame, a frame under one point, or no screens read, plus an absent on-screen flag, it answered anotherSpace. That skipped a capture that used to fail noCapturableWindow. An unreadable AXMinimized or AXHidden also read as false. Now both claims need a usable frame and the screens, and another Space needs AXMinimized and AXHidden read false. Tests cover each unknown with the flag both present and absent. Sminos-Session: cursor235#b93055dd (cua on macbook)
…Space where Raise or a reopen would do nothing, and neither remedy offers Raise (refs #367) Ruling 1ea561bc:782 on the hosted measurement (run 44122922177): - The off-display and another-Space remedies drop Raise and ask the user (move it onto a display; bring it here or switch to its Space), in the observation's line, the screenshot error and agent-cursor.md. - A running app with no accessible window whose windows CoreGraphics and SkyLight place only on another Space (Electron) is refused at once, before the reopen and the 5 s window wait. - A Raise on a window read as on another Space is refused before anything is sent; off-display Raise is unchanged. Sminos-Session: cursor235#b93055dd (cua on macbook)
…ther-Space refusal, so an app opening its window here is still reopened and waited for (refs #367) The review of d778455 (P2): windowsOnAnotherSpace claimed another Space when any one layer-0 window was there, even with another window of the app on a Space shown now. Now any window whose membership meets the current Spaces vetoes the claim, whatever the app's other windows are on. Sminos-Session: cursor235#b93055dd (cua on macbook)
…367) Sminos-Session: cursor235#b93055dd (cua on macbook)
…er Space, and refuses what cannot reach one on another Space (refs #367) Sminos-Session: cursor235#b93055dd (cua on macbook)
…ther Space and then refused, and the fast another-Space answer (refs #367) Sminos-Session: cursor235#b93055dd (cua on macbook)
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
What changes
On macOS, an app whose window was off every display or on another Space gave an observation with no reason in it. In the dogfood case, MAWS showed an empty tree, and the screenshot said only "Screenshot unavailable". Now:
[window off screen: …]or[window on another Space: …], and take no screenshot (metacua/screenshotOmitted:windowOffScreen/windowOnAnotherSpace). getScreenshot fails naming the reason and the remedy. The line survives a no-change diff. Detection (native/engine/Sources/Engine/Placement.swift):timeoutReached; now they failwindowOnAnotherSpacein about 3 ms.SLSCopySpacesForWindows, looked up with dlsym). If those calls are missing, nothing is claimed.windowOnAnotherSpace) before anything is sent (SecondaryAction.swift). Live, it answered success and did nothing (below). Off-display Raise is unchanged.Unchanged: an on-screen window's tree and screenshot are byte-identical to main's, and so are a partly visible window, a minimized window and a hidden app.
Evidence
docs/evidence/2026-11-17-367-hosted/README.md; per-run files are on
probe/367-live(f69cd90). Everything ran on GitHub-hosted macOS with owned TextEdit and Electron fixtures. Each fix head was paired with the main of its day.noCapturableWindowon both heads;timeoutReached, 5015–5075 ms (6/6)windowOnAnotherSpace, 2.6–3.1 ms (6/6)noCapturableWindownoCapturableWindowwindowOnAnotherSpace, 2.8–3.9 ms, nothing moved (4/4)Independent before/after reads (active Space, window Spaces, CG frame, frontmost) were unchanged in every Raise cell, and all 16 surrounding observations succeeded.
Limits
Verification
swift test(native/engine), on the merged head: 1,262 tests, 0 failures, 1 skipped (pre-existing).services-engine-*test, 220 tests: 219 pass, 1 skipped (hosted-only).Plugin 0.28.8.
Closes #367
Sminos-Session: cursor235#b93055dd (cua on macbook)