Skip to content

fix(macos): refuse --fullscreen on every helper-captured surface - #2849

Merged
thymikee merged 6 commits into
mainfrom
fix/2799-macos-fullscreen-surfaces
Sep 23, 2026
Merged

thymikee merged 6 commits into
mainfrom
fix/2799-macos-fullscreen-surfaces

Conversation

@thymikee

Copy link
Copy Markdown
Member

Summary

screenshot --fullscreen on a macOS helper-captured surface (desktop, menubar, frontmost-app) now fails with INVALID_ARGS (details.reason: SCREENSHOT_FULLSCREEN_MACOS_HELPER_SURFACE_FIXED_FRAME) before any capture. Before, the helper parsed the flag, ignored it (_ = fullscreen), always captured the main display, and echoed the flag back as if honored.

The refusal is derived from usesMacOsSurfaceScreenshot, the same predicate that routes a screenshot to the helper, so a newly routed surface refuses too. The scope is wider than the issue, which named only desktop/menubar: live validation showed frontmost-app goes through the same helper path. macOS app sessions (runner path) keep --fullscreen. The helper's ignored flag and response echo are removed. The CHANGELOG notes the .ad/project-config impact.

Closes #2799. 14 files.

Validation

  • Validated head cf47df65b6, rebased onto main twice with CHANGELOG-only conflicts, no code change. Rebased head 477bcd120d: build, typecheck and targeted vitest green (17 tests).
  • pnpm check:affected --run green on cf47df65b6 (one earlier screenshot-density.test.ts timeout was a host-load flake: outside the diff, green alone and on the rerun).
  • pnpm check:macos-helper green (7 Swift tests).
  • Live on macOS: desktop without the flag captures 3024x1964; desktop, menubar and frontmost-app with --fullscreen each refuse before capture and write no file; Calculator app session captures 460x816 without the flag and the full display with it.
  • Reviewed by three adversarial reviewers plus a final ship review.
  • Risk: one Mac/macOS version only.

desktop and menubar always capture the main display through the macOS
helper, so an explicit --fullscreen on either named a frame the
capture could never vary. It was parsed, ignored, and echoed back
unchanged. Refuse it before any capture with a typed INVALID_ARGS
reason instead. macOS app sessions (runner path) and every other
platform keep accepting --fullscreen unchanged.

Remove the now-dead --fullscreen plumbing: the helper's argument
parse, its capture parameter, and the fullscreen response field; the
TS helper argv and its return type.
…uter

The provider-scenario suite still sent screenshotFullscreen:true on the
desktop surface and asserted a --fullscreen helper argv, so it exercised
the pre-fix contract and was the only test reaching the refusal through
daemon -> bound screenshot runtime -> interactor. Add a direct refusal
check (INVALID_ARGS, details.reason
SCREENSHOT_FULLSCREEN_MACOS_HELPER_SURFACE_FIXED_FRAME, no helper call),
strip screenshotFullscreen from the two desktop capture steps and their
expected argv, and stop echoing the retired fullscreen field from the
fake helper.

Update the desktop-inspection recipe and add a prose note documenting
that desktop/menubar refuse --fullscreen. Record the behavior change in
the changelog, including its effect on recorded scripts and project
config that set screenshotFullscreen for those surfaces.
…cate

rejectsMacOsHelperFullscreen hand-listed desktop/menubar as a second,
independently maintained copy of usesMacOsSurfaceScreenshot's routing
condition, so it silently missed frontmost-app: that surface also
captures through the macOS helper's fixed main-display frame but kept
accepting and ignoring --fullscreen. Key the refusal directly off
usesMacOsSurfaceScreenshot instead, so every surface it routes to the
helper today or in the future refuses the flag, and delete the
separate list.
Derive the covered surfaces from SESSION_SURFACES filtered to
non-'app' (the routing predicate's own domain) instead of a hand
list, so screenshot-macos-surface.test.ts now exercises
frontmost-app alongside desktop/menubar and stays complete if a
future surface is added. Add a matching frontmost-app refusal check
to the provider-scenario daemon-router test, next to the existing
desktop one.
…d surface

The screenshot command's cliDetail, the commands.md prose, and the
Unreleased CHANGELOG entry named only desktop/menubar; widen them to
match the fix now that frontmost-app also refuses.
@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-23 18:47 UTC

@github-actions

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
Installed (including dependencies) 4.80 MB 4.81 MB +1.0 kB
Package (unpacked) 4.80 MB 4.80 MB +1.0 kB
Package (download) 1.43 MB 1.43 MB +518 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 28.1 ms 28.0 ms -0.1 ms
CLI --help 79.6 ms 81.4 ms +1.8 ms

@thymikee

Copy link
Copy Markdown
Member Author

Reviewed at 477bcd1. This looks good and is ready for human review. The refusal comes from usesMacOsSurfaceScreenshot, the same predicate that routes to the helper, with a typed reason before any capture, and the helper no longer takes the ignored flag.

Not blocking: the ScreenshotResponse encoding test (ScreenshotResponseTests.swift) guards the new two-field shape; it cannot reproduce the old bug, so a short note about that could help.

All 20 checks are green. The live macOS results are the ones reported in the PR body.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Sep 23, 2026
@thymikee
thymikee merged commit 5d0e66d into main Sep 23, 2026
20 checks passed
@thymikee
thymikee deleted the fix/2799-macos-fullscreen-surfaces branch September 23, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(macos): reject --fullscreen for macOS desktop/menubar helper surfaces

1 participant