You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
macOS engine: type_text after a key equivalent can answer unconfirmed with the text correct (stale before-snapshot) #386
#354's type_text read-back takes its before-snapshot when the request arrives. If the previous key equivalent's effect (Cmd+V, for example) hasn't landed yet, the snapshot is stale. The expected value is then computed from text that no longer stands, and a correct result answers typeUnconfirmed.
Measured in #354's hosted A/B (run 43752829833): of 296 branch unconfirmed answers in the race cells, 65 had the field correct, and all 65 were already correct within 1–5 ms of the answer. So a longer read-back budget doesn't help. In Chrome for Testing's Cmd+V cell, 30 of 40 were this case. In one example the expected length was 59, computed without the paste, while AX already read the correct 81.
These answers are safe (unconfirmed, never a false success), but the agent is told to check text that is in fact right.
Constraint
#354's spike found no fence that survives: effects land arbitrarily late. So a fixed settle wait before the snapshot can lower the rate but not remove it.
Ideas to measure
A short settle before the snapshot only when the previous request on that app was a key equivalent, measured for how many false unconfirmeds it removes and what it costs.
When the read-back mismatches, check whether it equals the expected text with the previous key's effect applied (the paste's clipboard text inserted), and answer with that distinction.
Check
In the A/B's race cells, the branch's unconfirmed answers whose field was correct fall well below 65/296, with 0 wrong successes kept.
Spawned by #354. Documented as a known cost in #354's docs: "unconfirmed after a key equivalent may mean the text is right: observe".
Closed by #354's settle (PR #396, cua 0.28.4, cde920f; ruling 754). In the race cells, a type right after a key, the false unconfirmed count with the final field correct fell from 30 to 3 in Safari, 95 to 7 in Chrome for Testing, and 162 to 6 in Firefox, of 240 each (run 44031200818, before 3141f17 vs after a7529ee), with 0 wrong successes. Clean cells: 720/720 confirmed. The settle runs only after a key posted to the same pid within 1 s: 1–2 reads, ~50–60 ms p50 added to the snapshot. A no-key call pays nothing. The remaining refusals (12 valueMismatch, 4 Firefox rangeUnreadable) are stated in #354's docs as the known cost: unconfirmed after a key equivalent may mean the text is right, so observe.
Additional measurement from #359 on main 15acf09 (includes #354/#360/#366), run https://github.com/SSFSKIM/cua/actions/runs/44107967517, kit 6f8c739. Of 2,677 scorable typing answers, 181 were typeUnconfirmed although every final DOM value and all 543 tail samples were exactly NEW359 with caret [6,0]. Plain natural click: 75/437 (65 script-selection,10 Cmd+A); plain no-click:42/480 (all script-selection); instrumented candidates:64, kept separate. Reasons are177 valueMismatch,2 fieldUnreadable,2 fieldChanged; no truncation/cap/settle-cap reason. All177 mismatch errors show correct actual AX text NEW359 (length6), but expect the full29-character seed plus insertion (length35). This is baseline/confirmation disagreement, not a wrong final replacement. The script-only no-click cases are outside this ticket’s key-only settle trigger. Current evidence does not log the actual before-snapshot or prove a new root cause; #359’s separate real select_text/Cmd+A follow-up is being used to distinguish ordinary agent flows from fixture-script-only cache lag. No reopening or product change is claimed by this comment.
Activity
Docs: the caret tied to its value, and a key equivalent's race that r…
Docs: the settle before the snapshot in #354's entry and the typing p…
macOS engine: type_text reads the field back and answers typeUnconfir…
SSFSKIM commentedon Nov 17, 2026
Closed by #354's settle (PR #396, cua 0.28.4, cde920f; ruling 754). In the race cells, a type right after a key, the false unconfirmed count with the final field correct fell from 30 to 3 in Safari, 95 to 7 in Chrome for Testing, and 162 to 6 in Firefox, of 240 each (run 44031200818, before 3141f17 vs after a7529ee), with 0 wrong successes. Clean cells: 720/720 confirmed. The settle runs only after a key posted to the same pid within 1 s: 1–2 reads, ~50–60 ms p50 added to the snapshot. A no-key call pays nothing. The remaining refusals (12 valueMismatch, 4 Firefox rangeUnreadable) are stated in #354's docs as the known cost: unconfirmed after a key equivalent may mean the text is right, so observe.
SSFSKIM commentedon Nov 17, 2026
[board] in-progress: Resolved inside #354
SSFSKIM commentedon Nov 17, 2026
[board] in-review: Landed in #354's PR
SSFSKIM commentedon Nov 17, 2026
[board] done: Resolved by #354's settle (PR #396, 0.28.4)
SSFSKIM commentedon Nov 17, 2026
Additional measurement from #359 on main 15acf09 (includes #354/#360/#366), run https://github.com/SSFSKIM/cua/actions/runs/44107967517, kit 6f8c739. Of 2,677 scorable typing answers, 181 were typeUnconfirmed although every final DOM value and all 543 tail samples were exactly NEW359 with caret [6,0]. Plain natural click: 75/437 (65 script-selection,10 Cmd+A); plain no-click:42/480 (all script-selection); instrumented candidates:64, kept separate. Reasons are177 valueMismatch,2 fieldUnreadable,2 fieldChanged; no truncation/cap/settle-cap reason. All177 mismatch errors show correct actual AX text NEW359 (length6), but expect the full29-character seed plus insertion (length35). This is baseline/confirmation disagreement, not a wrong final replacement. The script-only no-click cases are outside this ticket’s key-only settle trigger. Current evidence does not log the actual before-snapshot or prove a new root cause; #359’s separate real select_text/Cmd+A follow-up is being used to distinguish ordinary agent flows from fixture-script-only cache lag. No reopening or product change is claimed by this comment.