Skip to content

Engine: cua owns and releases Chrome's AXEnhancedUserInterface (end_task, stop, 30 s idle), and a never-seen Chrome is established at click time (#292, #288) - #295

Merged
SSFSKIM merged 10 commits into
mainfrom
fix/288-fresh-chrome
Nov 6, 2026

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

cua turned on Chrome's full accessibility mode and never turned it off (#292). Chrome has no AXManualAccessibility, which is Electron's attribute. It lists AXEnhancedUserInterface (EUI), so the engine has always written EUI to Chrome. Chrome answers the write with −25208 (not implemented), yet acts on it: 2.2 s later it turns on its complete mode and its screen-reader flag. The engine counted −25208 as a failed write, so it never owned EUI and never released it. Chrome kept the mode for its whole life. While it does, AX-driven moves and resizes of Chrome's windows animate.

The owner ruled that EUI is acceptable while cua drives that Chrome, provided cua releases it when done. This PR owns it and releases it.

#288: the first click into a fresh Chrome waits on Chrome's fixed 2.2 s debounce. #288's spike (Chromium's source plus measurement) found that EUI is the only route to complete mode on macOS, and nothing reaches it faster. So the latency limit is re-stated at its measured bound. The toolbar limit is replaced by a click-time establishment.

Closes #292
Closes #288

What changes

Own and release (#292)

  • An EUI write answering −25208, then reading true, counts as set. It is owned per the A3 rule: only when it read false before, or when the engine wrote it back since.
  • Released at whichever comes first (the design session's rulings 1ea561bc ecc2143d and 5c2f27a3):
    • end_task, at once. The client sends endTask and awaits its answer, bounded at 1 s, before closing. The engine still handles an endTask buffered behind a failed write.
    • Engine stop: the shutdown request and the termination signals. A terminal stopping state stops any in-flight request from re-enabling.
    • 30 s after the last observation or input on that pid, whether or not a connection is still open. A newer activity cancels a pending release. The token is checked again under the entry's lock.
  • An input after a release re-enables EUI, owned, and counts the process as fresh. Every input to a Chromium-family app takes the enablement step. So a click on a stale element 40 s later is element-routed rather than refused.
  • The re-read deadline. macOS engine: a left click into a background Chrome page is swallowed as the window's activating click, and cua reports success #282's press re-read and macOS engine: a background Chrome text-field click in shared mode focuses the field through AXFocused, and says the caret was not placed #283's box re-read now wait until the later of 2 s from their start and freshSince + 2.6 s, capped at 3 s from their start. Complete mode lands about 2.2 s after the write.
  • The observation reports enablementWrite success with enablementWriteError −25208 for such a write.

The toolbar step (#288)

  • A route-3 left click into a Chromium process with no web area seen first establishes one. It reads the application's role, searches the target window for an AXWebArea, then hit-tests again. A hit that is still a container is re-hit every 25 ms, for up to 500 ms (the whole step 600 ms).
  • Everywhere, a hit or a walk element that has an AXWebArea child, or whose children can't be read, is a possible web area, never outside.
  • Recorded as pointerEstablish {ms, webAreaFound, rehits} (cua/pointerEstablish).

Docs

Live proof (hosted macOS runner)

docs/evidence/2026-11-06-eui-release/ holds run https://github.com/SSFSKIM/cua/actions/runs/42168334138 at 6392694, and the earlier 42167787338 at 96c6f09. Chrome for Testing 156 behind a frontmost TextEdit, 2 reps each, all alike.

Cell main This branch
end_task EUI stays on {released: 1} in 2 ms; EUI false, checkbox AXPress and text boxes gone 12–15 ms later; a window move settles in 2 frames (8–55 ms) against main's 4–6 frames (94–159 ms)
SIGTERM EUI stays on released in 27 ms
Grace never released an idle open connection released 31.7 s after its last observation; a re-observation at 20 s moved the release to 32 s after it
Click after a release (1.6 s after, no re-observation) – re-enabled and element-routed (AXPress, the checkbox changed once) in 2.4 s
First quick click, 0.1 s after the first observation about the same as the branch 1.7–2.0 s (checkbox press), 1.7–1.9 s (textarea focus)
No web area seen (after a grace release) – the step ran in 10–24 ms; Reload walked outside and was posted; page text refused with nothing posted

#288's spike (runs 42161269408 and 42162367095) measured each candidate trigger.

  • A role read gives Basic mode only.
  • AXManualAccessibility is unsupported on Chrome.
  • An AXObserver, screen-reader reads, and deep reads every 150 ms never reached complete mode.
  • EUI reached it 2.19–2.26 s after the write, every time. Writing EUI false leaves complete mode in 4–150 ms.

Limits

Tests and review

Sminos-Session: cursor235#b93055dd (cua on macbook)

… the engine's stop, or 30 s after the last observing connection closed (refs #292)

Chrome lists AXEnhancedUserInterface (AXManualAccessibility is Electron's) and answers its write with
kAXErrorNotImplemented while acting on it, so the engine never owned it and Chrome kept complete mode
past cua. A -25208 write that reads true right after counts as set (owned by the A3 rule), and a
-25208 write back counts as done.

The release comes at whichever is first: the service's end_task now sends endTask before closing,
which releases at once what only that connection observed or acted on; the engine's stop (shutdown
or a termination signal); or enablementReleaseGraceMs (30 s) after the last observing or acting
connection closed otherwise, a timer token that a new observation, input or close replaces. An input
counts as an observation. Grace 0 is the previous immediate release.

Docs: the Enablement header, a #292 Decision Log entry with one pointer line in #282's and #283's,
and a correction note in the chrome-first-mouse evidence README.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…stablishes it first, and an element with an AXWebArea child is never outside (refs #288)

#288's hosted spike: before any role read a page point hit-tests to a coarse AXScrollArea that walks
to the window; after the application's role read a window search finds the AXWebArea in 11-29 ms,
but the point can still answer the web-contents AXScrollArea (the web area's parent) for 40-350 ms.

pointerView now counts a hit, or any element on its walk, with an AXWebArea child as a possible web
area. A route-3 left click (coordinate, or an element click's synthesized path) into a Chromium
process with hasSeenWebArea false first reads the application's AXRole, searches the window for an
AXWebArea (noteWebArea when found), and hit-tests the point again, re-hitting a container every
25 ms for up to 500 ms, the step bounded at 600 ms, nothing activated or posted. The meta records
pointerEstablish {ms, webAreaFound, rehits}, which the service passes as cua/pointerEstablish.

Sminos-Session: cursor235#b93055dd (cua on macbook)
… when it searches (refs #288)

Sminos-Session: cursor235#b93055dd (cua on macbook)
…ut, an input after a release re-enables it fresh, and the re-reads wait out Chrome's debounce (refs #292)

The design session's limits text is "30 s after cua's last action on that Chrome": each observation,
input, and request end arms a per-process timer token, and the newest one releases even while a
connection stays open (a model that never calls end_task keeps it until the 15-minute idle stop).
A close without end_task releases only a process with no timer armed (a failed release, retried).
A released process still observed is kept, and its next observation re-enables it, owned.

An input to a Chromium-family process takes the observation's enablement step (inputEnablement),
so an action after a release sets EUI again, owned, and moves freshSince. #282's action re-read and
#283's box re-read now run until the later of 2 s and freshSince + 2.6 s, capped at 3 s, since
complete mode lands about 2.2 s after the write. The first-click limits say about 3 s.

Sminos-Session: cursor235#b93055dd (cua on macbook)
Sminos-Session: cursor235#b93055dd (cua on macbook)
… and unknown is a possible web area, never outside (refs #288)

The review of d2568c7..96c6f09: a failed children read counted as no AXWebArea child, so a
web-contents AXScrollArea whose children could not be read walked to AXWindow and, with a web area
seen, a page point counted as accepting first mouse. hasWebAreaChild now answers nil for unknown,
the walk takes it as incomplete, and the establishment keeps re-hitting an unknown hit.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…e release re-checks its token under the entry's lock (refs #292)

The review of d2568c7..96c6f09. releaseAll (the shutdown request and a termination signal) now
sets a stopping state under the class lock before taking the processes; from then on enableReporting
writes nothing (checked again under the entry's lock) and noteActivity records nothing, and every
owned entry is reset whatever its observers, so a request still running cannot register or
re-enable after the stop's reset. A grace timer's token is now checked again under the entry's lock
before the reset, so activity landing between its first check and the reset makes it stale.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…he engine still handles an endTask buffered behind a failed write (refs #292)

The review of d2568c7..96c6f09: the relay closes fully (end, then destroy), and Server.serve
stopped reading once an earlier answer's write failed, so an endTask buffered behind the cursor hide
could be lost and EUI left to the grace. The client now unpublishes the connection, fails its
waiting requests at once, sends the hide unawaited and endTask, and closes on endTask's answer, an
error, or after 1 s (end_task's hook stays bounded at 2 s). The server, after a failed write, reads
the frames already buffered (each read bounded at 1 s) and handles an endTask among them. Tests: a
fully closing relay in the client suite, a buffered endTask behind a closed peer in the engine's.
Decision Log: the review's four findings in #292's entry and #288's container rule.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…SIGTERM and the grace release EUI; a click after a release is element-routed; the toolbar establishment runs; Reload after idle fails on main too, #294)

Sminos-Session: cursor235#b93055dd (cua on macbook)
…efs #292, refs #288)

Sminos-Session: cursor235#b93055dd (cua on macbook)
@SSFSKIM
SSFSKIM marked this pull request as ready for review November 6, 2026 06:01
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T06:03:56.142227Z 906d9c2 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@SSFSKIM

SSFSKIM commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

Update from #287: the configs this PR's Limits named as unmeasured are now measured (hosted macOS, main's engine at 51b473f, 2 reps).

Findings: #287 (comment)
Evidence: https://github.com/SSFSKIM/cua/blob/main/docs/evidence/2026-11-07-other-browsers/README.md

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

Labels

None yet

Projects

None yet

1 participant