Skip to content

Warn when native window screenshots cannot establish current visual state #204

Open

Description

@SSFSKIM

Problem & intent

All three reports describe covered Electron windows returning blank or apparently old pixels while actions had landed: /Users/new/Developer/GitHub/MAWS/plugin/cua/dogfood-feedback/l3-input.md Problems §2; l6-artifacts.md §1; l9-browser-delivery.md §§1,6. Costs included repeated actions and selecting an unrelated session. Verdict: plausible stale-paint symptom; confirmed absence of model-facing visibility/freshness context. Reports differ on whether AX was current, so AX is a cross-check, not an infallible oracle.

Pinned code: Screenshot.swift already uses ScreenCaptureKit desktopIndependentWindow capture; bind-mac-app.mjs returns image bytes without capture/visibility metadata. Replacing capture with ScreenCaptureKit is not a new fix.

Constraints

Preserve #117/#200 background non-interference. Never activate, raise, or hide another app to obtain an image. Do not call identical pixels stale, treat on-screen as unoccluded, or invent a compositor frame age.

Success criteria

  • Provide bounded, explicitly qualified visibility/occlusion information beside the emitted screenshot; distinguish capture time from content freshness.
  • When covered/not visible, warn that application painting may be suspended; retain usable images rather than blanket-refusing background capture.
  • Explain that action completion plus unchanged pixels is not proof of no delivery; require fresh state before retry.
  • Unit-test metadata/unknown states and warning emission; later validate on an authorized owned Electron fixture behind a sentinel window.

Open questions

Which visibility facts are reliably available without disturbing windows? If precise occlusion or content age is unavailable, say unknown rather than estimate certainty.

Decision log

2026-10-23: New scope after all-state screenshot/occlusion and Screenshot.swift searches; #177 has the observation, #200 owns raising/guard safety, not capture diagnostics. Category: enhancement; birth state: ready-for-implementer; parent N/A (dogfood follow-up, not a decomposition child); blocked-by N/A (can be investigated independently).

Sminos-Session: cua_repl#1ea561bc (MAWS on macbook)

Activity

  1. added
    enhancement
    status:ready-for-implementer
    priority:P2
    on Oct 23, 2026
  2. SSFSKIM commented on Oct 23, 2026

    @SSFSKIM
    OwnerAuthor

    Additional capture/observation evidence from /Users/new/Developer/GitHub/MAWS/plugin/cua/dogfood-feedback/l1-sessions.md §6, l2-transcript.md §2, l4-approvals.md §§1,3 and l5-code.md §6. L4 reports byte-identical native JPEGs minutes apart while AX changed, but also the reverse: Codex AX still said Thinking while the visual plan was already present. L5 hidden windows yielded No capturable window/Screenshot unavailable and sometimes only an AX shell.

    These strengthen the need to separate capture timestamp, covered/hidden/minimized state, application repaint freshness and AX observation freshness. Identical bytes do not themselves prove staleness; capture time is not paint time; AX is not a universally current fallback. At d95261f Settle.swift already defers a quiet wait until the next observation after an action, capped at 5 seconds; its notifications do not include AXValueChanged. Therefore “add any settle wait” is not the missing feature. Investigate value/AX lag separately within observation diagnostics, expose capped/unknown freshness appropriately, and avoid promising that a second read or Raise always repairs it. No live measurement performed.

    Sminos-Session: cua_repl#1ea561bc (MAWS on macbook)

  3. SSFSKIM commented on Oct 23, 2026

    @SSFSKIM
    OwnerAuthor

    Final-wave corroboration from /Users/new/Developer/GitHub/MAWS/plugin/cua/dogfood-feedback/l7-shell.md §6 and l8-settings.md §4: covered captures omitted text/shortcut-sheet changes that AX already showed; a later capture caught up. Raise sometimes did not help. Preserve the existing warning/unknown-state approach rather than forced re-composite or automatic window-order changes. L8’s frontmost loginwindow/Chrome observations do not establish an image’s exact compositor age. L7’s proposed composite action effect report can expose observation/visibility facts, but cannot equate unchanged AX or pixels with no app effect.

    Sminos-Session: cua_repl#1ea561bc (MAWS on macbook)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpriority:P2status:ready-for-implementer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions