Skip to content

macOS engine: the first observation of a freshly enabled Chromium/Electron app returns an incomplete tree (vendor's is complete) #244

Closed

Description

@SSFSKIM

Observed

#200's final live check (2026-11-01, MacBook, engine 07724139591e from fix/200-background-raise bf458b9) observed a freshly launched Electron fixture with each engine. Each fixture reported AXManualAccessibility false at start.

  • cua: the first observation, about 6.5 s after launch, took 1.24 s and returned 14 lines (326 chars) with no button. At +2 s it returned 27 lines (805 chars) with the button at index 13, and +5 s was the same. An earlier attempt in the same slot matched: 6 s after launch, 1.22 s, no button.
  • Vendor: the first observation, about 4.4 s after launch, took 66 ms and found the button at index 13.

So cua's first observation of a Chromium/Electron app whose accessibility tree is not yet enabled returns an incomplete tree. An agent that acts on that first read misses elements, or must observe again. This affects every Chromium/Electron app's first observation in a session: Slack, VS Code, MAWS itself, Chrome.

Evidence: docs/evidence/2026-10-30-macos-agent-cursor/item-200/final/ on fix/200-background-raise (the diagnostic's kit diff kept there).

Known

  • native/engine/Sources/Engine/Enablement.swift:
    • enablementAttribute follows the vendor's rule (AXManualAccessibility, else AXEnhancedUserInterface).
    • webAreaWaitNeeded waits after enabling until a web area has been seen in the process.
    • The first observation did wait (1.2 s), yet returned a tree without the button. This suggests the wait ends on an AXWebArea that exists but whose subtree Chromium is still building.
  • cua's documented departure is that the vendor waits on every Chromium observation (about 145 ms each) and cua only until the first web area is seen. That departure is about later observations, so it doesn't explain this first-read gap by itself.
  • The vendor's first read 4.4 s after launch was already complete in 66 ms. It may enable earlier (at bind or getApp) rather than at the first observation; read its helper to confirm.

To do

  1. Read the vendor helper for when it enables and how it waits on a fresh Chromium tree. Cite the function name and address.
  2. Choose the fix by measurement. Candidates, each with its cost on warm observations:
    • (a) enable at bind/getApp;
    • (b) after enabling, wait for a web area with content (children, or AXLoaded) rather than any web area;
    • (c) both.
  3. Write the test first where it can be stubbed. The live repro is the Own engine brings the driven app to the front in MAWS sessions (MacBook opt-in build) #200 kit's case f with the engine's observation first on a fresh fixture: the first observation must contain the button.

Relates to #200 and #117.

Activity

  1. added
    bug
    status:ready-for-implementer
    priority:P2
    on Nov 1, 2026
  2. added a commit that references this issue on Nov 1, 2026
  3. added
    status:in-progress
    and removed
    status:ready-for-implementer
    on Nov 1, 2026
  4. added 9 commits that reference this issue on Nov 1, 2026
  5. added
    status:in-review
    and removed
    status:in-progress
    on Nov 1, 2026
  6. SSFSKIM commented on Nov 1, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-review: PR #247: write-once enablement + app role read; live plain PASS

  7. added a commit that references this issue on Nov 1, 2026
  8. removed
    status:in-review
    on Nov 1, 2026
  9. SSFSKIM commented on Nov 1, 2026

    @SSFSKIM
    OwnerAuthor

    [board] done: PR #247 merged 2026-11-01T09:49:53Z as f1bc48e (main tree = PR head tree 15c25a53); plugin 0.20.3; residue #246

  10. added a commit that references this issue on Nov 1, 2026
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

    bugpriority:P2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions