Repository navigation
macOS engine: a Chromium app is acted on only once its accessibility is ready, and cua holds it on for 5 minutes idle (#366) - #399
Merged
Conversation
…he enablement write (refs #366) A first AX element action into Electron or Chrome answered success and ran no handler when it landed under about 2.25 s after the engine's enablement write (the spike's runs 44032504512 and 44052940748): every AXManualAccessibility write restarts Electron's debounce to its complete mode, and nothing signals the mode's arrival. Per ruling 766, execute's prologue now waits, for click, set_value, select_text, perform_secondary_action and scroll on an app whose page engine is .chromium, for what remains of chromiumActionWindowMs (2.5 s) since the engine's last accepted enablement write of the process (WebAccessibility.lastEnablementWrite). Past the window, or with no write, it waits 0. The wait runs after the input's own enablement step and the holds' steps and before the method takes any hold; a focus hold the connection still keeps on the app ends first, and a press inside a recorded menu's held span (AppKit's menu, not the renderer) does not wait. The answer is unchanged: a dispatch stays a dispatch. The engine and its web enablement take an injectable monotonic clock and sleeper. An enablement that reads true is not rewritten (unchanged: owned attributes are neither read nor written, another client's true is left alone), so it never restarts the window; the tests pin that, Chrome's -25208 write counting, the hold rules and the gated method set. Sminos-Session: cursor235#b93055dd (cua on macbook)
…ay wait up to 2.5 s (refs #366) agent-cursor.md's second paragraph, which describes the element actions cua takes in a background web page, gains one closing sentence. The docs oracle and the core-documentation test carry it byte for byte; PROVENANCE.md and the surface inventory's new "Table 3 addition (2026-11-17, #366)" record where it came from. The native engine spec's Decision Log gains the #366 entry (ruling 766): the gate and its window, no hold through the wait (a focus hold ends first, an in-menu press keeps its span and does not wait), read before write as it already stood, where the first enablement write lives and why it is not moved ahead of the open settle, "accepted" and "owned" as read here, and the per-method over-approximation. Sminos-Session: cursor235#b93055dd (cua on macbook)
… deadline, and scroll waits only with an element (refs #366) The review of c7eee72..d94039e found two P2s, both accepted: - A stale window after waking. A write over a value that could not be read is not owned, so another connection could write true again while the request slept, and the request woke inside the new window. The wait now re-reads lastEnablementWrite after every sleep and waits out what remains, until none does, before any hold or dispatch. - The deadline. The wait ignored it, so a request could dispatch after its client had timed out. A window that would end at or past the remaining deadline is now refused before the sleep as timeoutReached, with the input meta and nothing dispatched; the holds stay as they were. Scope: a scroll at a point or the window's centre only posts a wheel and reads back, and its #328 bar write never targets a web page's bar, so it no longer waits. A scroll that names an element still waits, because its AXScrollToVisible goes to the page first. The Decision Log records all three. Tests: a write landing mid-wait is waited out (2.5 s, then the 1.0 s left); a 100 ms deadline on a fresh write times out with nothing slept and the focus hold untouched; readiness exactly at the deadline is refused; a mid-wait write that pushes readiness past the deadline times out at the wake. Sminos-Session: cursor235#b93055dd (cua on macbook)
…ing (refs #366) The re-review found the deadline was checked only while a positive wait remained. A sleep that overshot (a 2,600 ms budget, a 2,500 ms sleep waking at 3,000 ms) found the window passed and returned ready, so the action went out after the client had timed out. Every wake now checks the deadline before the ready path returns and throws timeoutReached once it has passed. The probe is now a test with an overshooting sleeper, beside the same oversleep inside a roomier budget, which stays ready. Dropping the post-wake check fails it. The Decision Log's "#366's review" entry, item 2, records the rule. Sminos-Session: cursor235#b93055dd (cua on macbook)
…eadiness, the action backstop re-reads its target's own handle, and set_value answers valueUnconfirmed (refs #366) Ruling 772, on the live smoke and diagnostic run 44068144650: after the switch to complete mode the AX handles survive, but cua's cached metadata goes stale. Chrome's buttons gain AXPress, so a click planned from recorded actions refused noAction even after the action's wait. Fields gain their placeholder, so set_value's re-fetch after an accepted write threw elementNoLongerValid. - get_app_state, after its enablement step, waits out what remains of the 2.5 s window since the process's last accepted write (any request's), bounded by the deadline, with the action's loop (waitForChromiumReadiness: re-read after every sleep, no sleep past the deadline, an oversleep ends it). The wait is the chromiumReady phase and signpost. A settled tree read before readiness is not adopted. - A deadline-short observation reads anyway. Every entry records its read time (LineageEntry.recordedAt), and one read before the process's readiness counts as recorded before it. - The action backstop: after the action's wait, a target recorded before readiness is re-read from its cached handle (identity, actions, read time), never re-found by identity. An invalid or unreadable handle is elementNoLongerValid before any write. - set_value: a re-fetch that fails after an accepted write answers valueUnconfirmed in place of elementNoLongerValid. The tests cover the observation waiting and then recording complete-mode metadata, a deadline-short observation's marks, the backstop's refresh of a marked entry from the same handle with an unmarked one left alone, another handle never adopted (valid, invalid or unreadable own handle), and valueUnconfirmed after a placeholder change between write and re-fetch. The Decision Log records ruling 772. Sminos-Session: cursor235#b93055dd (cua on macbook)
…to 2.5 s, and set_value's valueUnconfirmed (refs #366) Ruling 772 moved the wait to the observation. agent-cursor.md's background- click paragraph now ends: the first observation of a Chromium-based app cua has just started reading may take up to 2.5 s longer, and an action sent before then waits for it. The fourth paragraph closes with valueUnconfirmed: a setValue whose value was sent and accepted but whose field could not be found again fails with it, so observe before any retry. The docs oracle and the core-documentation test carry both byte for byte. PROVENANCE.md, the surface inventory's new "(2026-11-17, #366, ruling 772)" addition and the engine service's header comment record them. Sminos-Session: cursor235#b93055dd (cua on macbook)
…t's own handle (refs #366) Review round 4 found a P2. A marked entry was refreshed from its own handle, then went on into the ordinary resolver. If the handle went between the two reads, the resolver fell through to the identity re-fetch and adopted another element matching the identity the refresh had just read (the probe moved t1 from handle 1 to 6). The refreshed resolution now ends at the refresh. It never enters the ordinary re-read or the identity re-fetch. The handle is validated before its read and again after it, and the entry changes only once both pass, so a refusal (elementNoLongerValid, before any write) leaves the entry as recorded and still marked. Regression, in the probe's shape and for each refetch mode: a marked entry whose handle validates for the refresh and then goes, with another element matching the refreshed identity. It is refused, with no walk, no adopted handle and the entry unchanged. Restoring the fall-through fails it. The Decision Log's ruling 772 entry records this. Sminos-Session: cursor235#b93055dd (cua on macbook)
…; end_task and the stop still release at once (refs #366) Ruling 775, on the live qualification: after a real release the Chromium attribute reads false, so the next observation writes it again and waits out #366's 2.5 s readiness window. With the 30 s grace, every agent pause over 30 s paid that. enablementReleaseGraceMs is now 300 000 ms, and its comments say why. end_task and the engine's stop are unchanged and release at once. The grace now outlasts the focus hold's 120 s bound, so an action after a grace release no longer meets a focus hold left from before it. The trade is #292's side effect (Chrome's complete mode, its screen-reader flag, animated window moves and resizes), which now lasts up to 5 minutes after cua's last step on an app whose task has not ended. The grace tests now run on the default grace on the fake timers: armed 5 minutes out, nothing at 30 s or 299 999 ms, released at 300 000 ms; re-observations and inputs restart it; end_task and the stop release at once with it pending. The Decision Log records ruling 775 and its limit. Sminos-Session: cursor235#b93055dd (cua on macbook)
…nutes idle, may take up to about 2.5 s longer (refs #366) Ruling 775. agent-cursor.md's background-click paragraph now says plainly when the wait comes: the first observation of a Chromium-based app in each task (each end_task ends one), and again after 5 minutes without observing or acting on it, may take up to about 2.5 s longer, and an action sent before then waits for it. The docs oracle and the core-documentation test carry it byte for byte; PROVENANCE.md and the surface inventory's "(2026-11-17, #366, ruling 775)" addition record it. Sminos-Session: cursor235#b93055dd (cua on macbook)
…6-chromium-ax-ready (refs #366) Conflicts resolved, keeping both sides: - agent-cursor.md and its copies (docs-oracle.mjs, core-documentation test): the background-click paragraph keeps #360's Firefox arrow-key sentence, then #366's first-observation wait as its last sentence. The fourth paragraph ends with #366's valueUnconfirmed. #354's sixth paragraph (typeText's read-back, typeUnconfirmed) stays as main has it. The copies are byte-identical, and their comments name both sides' sentences. - PROVENANCE.md: both sides' provenance and contents for agent-cursor.md. - The surface inventory: main's #360 and #354 additions first, then #366's three. #366's quotes of the background-click paragraph now carry #360's sentence, so the last one equals the merged paragraph. - The native engine spec's Decision Log: chronological, so main's #360 entry (2026-11-16) before #366's four (2026-11-17). Methods.swift and service.mjs merged cleanly. Sminos-Session: cursor235#b93055dd (cua on macbook)
… is ready (refs #366) #366's fix in the plugin's engine. The first observation of a Chromium- family app after cua enables it waits for the complete accessibility mode before reading the tree. An element action waits too, re-reading a target recorded earlier from its own handle. set_value answers valueUnconfirmed when its field cannot be found again after an accepted write, and the enablement's idle release now comes after 5 minutes. Sminos-Session: cursor235#b93055dd (cua on macbook)
…n and the five-minute lifecycle smoke (refs #366) 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, the first action on a background Chromium-based app (Chrome, Chrome for Testing, Electron apps) could reach nothing.
AXManualAccessibilityin Electron,AXEnhancedUserInterfacein Chrome) when it first observes the app. Chromium then rebuilds its tree in complete accessibility mode after a debounce of about 2 s, and every write restarts the debounce.backgroundClickRefused, because the cached element still carried basic mode's action list.elementNoLongerValid, because the field's placeholder only appears in complete mode and the identity re-check compares it (Engine: element identity compares the placeholder, so a field whose placeholder changes reads as a different element #398).Now, in
native/engine:awaitObservationReadiness, Skyshot.swift; ruling 1ea561bc:772). So the tokens it hands out already belong to complete mode.waitForChromiumReadiness, ChromiumReadiness.swift; Methods.swift's action gate). An entry recorded before readiness is first re-read from its own live handle, pinned to that handle (Lineage.resolve(readiness:),refreshFromHandle). It never falls back to an identity search that could adopt another element.valueUnconfirmedwhen the value was written and accepted but the field can't be found again afterwards, in place ofelementNoLongerValid(ValueSetting.swift).agent-cursor.md (and its two copies) says the first observation of a Chromium-based app in each task, and again after 5 minutes idle, may take up to about 2.5 s longer. It also documents
valueUnconfirmed. Unchanged: non-Chromium apps, and any observation or action once the window has passed.Evidence
The tables are in docs/evidence/2026-11-17-chromium-ax-ready/README.md. Every cell is judged by the fixture page's own handler count and its DOM/React value, never by AX or by an RPC answer.
The full qualification, 44080159451 (fix 22f4d30 against main c7eee72; default Electron, parity Electron and CfT):
Raises, the matched supplement, 44085341355 (green, 80/80 launches):
The 5-minute grace, 44086986242 (head 3bb77a9, 9 launches):
owned, nothing is written, and the wait is 0.004–0.028 ms.Two red runs, both in the test kit
src/services/engine/client.mjs,attempt/establish), so production can't hit this. Kit 8cda5b9 bounds the kit's connect, and recovery run 44087018258 measured the missing cell: delivered once, wait 2574 ms. The invalid attempt stays on record.Limits
Verification
swift test(native/engine), after merging main 4a3e26e: 1,235 tests, 0 failures, 1 skipped (pre-existing).Plugin 0.28.6.
Closes #366
Sminos-Session: cursor235#b93055dd (cua on macbook)