Feature request: configurable post-action observation and text-field settle delays in MCP
Problem
I am using Cua Driver 0.28.2 through MCP to automate a native macOS application. For a known flow, I already have an independent application-state observer and explicit outcome checks, but I could not find a supported public MCP option to avoid the driver's additional post-action waits.
The flow is simple: focus a block, press Enter to create another block, press Tab to nest it, and type content. It runs against an isolated in-memory fixture. Jev chooses the actions, CUA executes them, and a local application API independently verifies the final text, nesting depth, block count, and unchanged parent.
Measurements
I polled the application state concurrently with each pending CUA call, without dispatching another action before that call returned:
| Action | First observed application-state change | MCP call returned |
|---|---|---|
| Click block text field | 84.89 ms | 1900.10 ms |
| Press Enter | 35.26 ms | 1103.07 ms |
| Press Tab | 24.62 ms | 1108.34 ms |
The journey passed its independent final assertions. These are local measurements from one application, not a general benchmark. The first state change is not necessarily proof of a fully completed action; for example, a text insertion can publish partial content before it finishes.
What I tried
- Reused the MCP session and the model's HTTP client.
- Used fresh accessibility snapshots without redundant screenshots in the decision loop; video capture runs separately.
- Replaced caller-side fixed sleeps with application-state polling.
- Set the session cursor glide to 50 ms and dwell to zero using
set_agent_cursor_motion. This reduced the click from approximately 3.35 s to 1.89 s in a local before/after comparison. - Checked the public tool/config schemas and the release source for configurable post-action observation.
These changes helped, but even in this known flow, observing the expected state externally does not let the caller complete the pending MCP action sooner. I did not find a supported workaround that preserves serial input execution and driver error reporting. I have not patched or rebuilt the driver, injected private registry arguments, or overlapped input actions.
Relevant source
Release commit: fc188250b4ca8549b8e61f937fdb1fb560770e86.
window_change_detector.rsdefines a 1,000 ms observation timeout, polled every 50 ms.click.rsadds an 800 ms settle delay for text inputs. The condition at line 1412 covers AXTextField/AXTextArea even though the comment describes WebKit.finish_window_observationhas a private opt-out for embedded interactive clients, but I could not find an equivalent supported public MCP option.
Requested functionality
Could we expose supported options, ideally scoped per session with per-action overrides, for:
- A configurable post-action window-observation timeout.
- A configurable text-field focus settle timeout, or a condition-based early exit when focus is confirmed.
- An explicit caller-managed observation mode for clients that independently verify action-specific postconditions.
Current behavior could remain the default. For the text-field settle specifically, could the WebKit-specific delay be limited to the relevant surfaces?
The desired behavior is similar to condition-based waiting in browser automation: proceed as soon as the required condition is satisfied, with the timeout serving as an upper bound rather than an unavoidable delay.
Correctness expectations
Reducing these waits should retain window ownership checks, stale-target rejection, and input-delivery safeguards. Responses should continue distinguishing input dispatched from effect confirmed. Skipped or inconclusive observation should be explicit, not reported as verified.
If there is already a supported way to configure this for a known native flow, I would appreciate a pointer. Otherwise, a public option would significantly help low-latency agent loops like this one.
I also tested the Python SDK (cua-driver==0.28.2) using CuaDriver.connect(None), bypassing the MCP proxy while connecting to the same daemon.
I ran three trials per transport with the same four actions: click, Enter, Tab, and type. All six runs passed independent application-state assertions. Clients remained connected, and model calls were excluded.
| Transport | Median total for four action calls |
|---|---|
| MCP | 5,498.67 ms |
| SDK → daemon | 5,488.41 ms |
The ~0.2% difference shows no meaningful speedup in this small comparison. Bypassing MCP appears insufficient to avoid the driver's observation delays.
I also instantiated the in-process SDK via CuaDriver.create(None), but the Python host lacked Accessibility and Screen Recording permissions, so I have not benchmarked actions in that mode.
Is there a supported SDK option for caller-managed post-action observation, or does that currently require changes to the driver?
Real-world datapoint from a macOS (Apple Silicon) fleet setup — cua-driver 0.28.1, browser_prepare strategy.kind=existing_profile with our own temp-profile Chrome on --remote-debugging-port (standalone window).
Measured on a scripted 13-action web flow (login → add 2 items → cart → checkout → fill 3 fields → submit → confirm):
- Every state-changing
browser_clickwithinput_route:"dom_event"on a ref: 2.46–3.26 s constant, result carrieseffect:"unverifiable". browser_typewithmode:"insert_text": ~2.5 s when the field value actually changes, but 0.09 s when it is a no-op (same value,replace:true) → the cost is a post-dispatch observation/settle phase, not dispatch or typing itself.input_route:"trusted": refused (route_unavailable, in 0.08 s) for this standalone browser even with the window frontmost — so the fast native route is never available in exactly the setup where agents run background loops;dom_eventis the only working route.cua-driver config showexposes no settle/observation/timeout knob in 0.28.1.
Impact: the 13-action flow spends 35 s of its 43 s (82%) in these fixed settles. A standard agent loop already re-reads page state and verifies the expected postcondition after each action, so the fixed settle is paid in addition to caller-side verification.
Ask: ship the #3493-style wake-on-first-change path and/or expose the post-action observation budget (config set … + optional per-call override, including a "skip internal observation" mode for self-verifying callers). Reproducible in minutes on macOS — happy to run a patched build and report timings, or share the full per-step trace (13 steps, phase-level timings).
(Very happy with the driver otherwise — typed refs + dom_event route are rock-solid; this is purely about the fixed settle cost.)
Your measurements make a useful contract distinction visible: input dispatch, driver-owned post-action observation, and caller-owned verification are three different phases. I would expose that distinction directly rather than making a shorter MCP latency look like a stronger outcome claim.
A practical result shape could separate:
dispatch: accepted, rejected, or error;observation: confirmed, pending, skipped, timeout, or unavailable;observation_msand a bounded reason/code; andverification: driver-owned, caller-managed, or not attempted.
Then provide a session default plus a per-action override. A caller-managed mode should skip only the internal wait—not ownership checks, stale-target rejection, focus/input safeguards, or error reporting. If the driver returns observation: skipped, it should never imply that the application effect was confirmed.
For condition-based early exit, I would keep the condition an explicit, bounded observer (for example, a known application-state predicate or a confirmed text value) and retain a hard upper bound. The acceptance matrix should include a no-op, focus loss, target replacement, modal interruption, timeout, driver error, and a second action attempted before the first result is returned. That would also make the 800 ms text-field settle path measurable separately from the general window-observation budget.
I maintain Hronaut, a local MCP browser workspace; this is an independent interoperability note, not a product claim or request for promotion. The same rule matters in browser workflows: a tool response and a page-reported change are not substitutes for an independently checked postcondition. This comment was prepared with AI assistance.
There is an existing internal seam in current main that may make the smallest implementation cleaner than adding several independent timeout knobs.
On macOS, finish_window_observation() already supports exactly one of the requested execution modes:
if args
.get("_skip_window_change_detection")
.and_then(Value::as_bool)
.unwrap_or(false)
{
drop(snapshot);
Changes::no_change()
} else {
snapshot.detect_async().await
}
and the source comment says this is for:
Embedded interactive clients that already observe the target continuously
So “caller-managed observation” is already a real behavior contract inside the driver. It is just private, untyped, and only reachable through a registry argument.
That suggests a relatively small architecture change:
Promote the existing observation policy to the public/session contract instead of exposing the private
_skip_*argument or starting with raw millisecond tuning everywhere.
Conceptually:
PostActionObservation
DriverManaged # current default
CallerManaged # skip only driver-owned post-action polling
with an optional bounded driver timeout as a separate setting later if needed.
The result must still say that observation was skipped/caller-owned rather than reuse Changes::no_change() as if “no change was observed”. The internal shortcut currently works because its callers already know what they asked for; a public API should preserve that provenance.
The 800 ms text-field wait is a different mechanism
Current click.rs says:
// WebKit DOM focus settle: 800 ms for text inputs
let needs_webkit_delay =
ax_action == "AXPress"
&& (role == "AXTextField" || role == "AXTextArea");
The predicate does not actually prove WebKit. Any native AXTextField / AXTextArea reached through this path inherits the same fixed settle.
I would therefore avoid folding this into the general observation mode. It has a different ownership question:
- window observation answers “did this action alter window/frontmost state?”;
- text-field settle is trying to ensure “is the target ready for immediate keyboard input?”
For the latter, the durable speedup is probably evidence-based early exit rather than a smaller global constant: if focus/readback proves the intended field is ready, return immediately; retain the existing bound as fallback for surfaces where readiness cannot be proven.
UX / architecture split
That gives callers a simpler mental model:
dispatch safeguards always driver-owned
exact target / stale ref / focus / route / error checks
post-action window observation policy-owned
driver-managed (default)
caller-managed
target readiness settle action-specific evidence
complete when proven
bounded fallback otherwise
business postcondition caller/application-owned unless explicitly provided
The first row should never become optional just because a client is fast. That preserves the safety properties the issue asks to keep while removing duplicated waiting for self-verifying agent loops.
This is also easier to extend across transports: the private seam proves the optimization belongs below MCP, which matches the SDK-vs-MCP timing data. MCP, SDK and in-process clients can all select the same typed policy instead of each transport growing its own latency option.
A useful conformance test would verify the public caller-managed mode and the private embedded path produce the same dispatch/safety behavior, differing only in post-action observation ownership. That turns the existing optimization into a supported contract rather than adding a second fast path.
I did a cross-repo backlog/PR pass after the earlier observation-policy note, and there are already three overlapping implementations of this latency seam. I think the most useful next step is consolidation rather than a fourth patch:
- #3488: keeps the existing 1000 ms default and adds an internal/env deadline override. It already went through review specifically rejecting a globally shorter default because delayed windows are real.
- #3929: lets an embedding host bound/skip the same post-action observation while leaving public callers unchanged; measured background AX click 1153 ms → 78 ms at a zero observation budget and observe→click→observe 1326 ms → 232 ms.
- #3946: exposes a public per-call
detect_window_changeboolean, routesset_valuethrough the shared seam, and carries the strongest broad measurement set (305 action ops; the poll accounts for ~74–92% of several common action paths).
That means the implementation question is no longer “can this wait be removed?”; it is which layer owns the policy.
Given the repo's current RFC contract, I would split the work:
- Canonical internal seam first. One Driver-internal post-action observation policy/budget used by the existing trusted opt-out, embedding hosts, and every action (including
set_value). Defaults stay unchanged. Salvage the parser/propagation tests from #3488/#3929 and the cross-action normalization/tests + measurements from #3946. - Public exposure is a separate decision. A new public action field changes the generated MCP/SDK contract, so the exact public shape should get the required RFC/maintainer decision rather than being decided indirectly by whichever latency PR lands first.
- Do not mix the 800 ms text-field readiness settle into this policy. That path should wake when focus/readback proves readiness and retain the existing bound when it cannot be proven; “a window did not change” and “this field is ready for the next keystroke” are different facts.
A useful shared regression matrix for the internal seam would be:
driver-managed + quiet action -> old bounded observation behavior
driver-managed + delayed new window -> window-change evidence preserved
caller-managed / trusted opt-out -> dispatch safeguards unchanged, no poll
set_value -> obeys the same policy as other actions
unknown/unset policy -> current default
and the result should preserve provenance: skipped/caller-owned observation is not “no change observed.”
This seems like the smallest path that preserves all three contributors' useful work while avoiding three subtly different owners of the same 1 s wait.
Read all three before answering. Your reading of #3488 is the current one; #3946's earlier description had it at its first revision (300 ms default), and today's rewrite dropped that line.
What #3946 is after today's consolidation: the per-call detect_window_change input on click, drag, scroll, type_text, press_key, hotkey and set_value; set_value routed through finish_window_observation instead of calling detect_async() directly; the 305-op measurement set; and two same-family time-cost fixes folded from #3925 and #3806 (drag does not re-activate a frontmost target; scroll amount clamped on the keystroke path) that do not touch the poll.
-
Agreed, and it is the right first slice. The three PRs differ only in who selects the policy, the daemon environment (#3488, #3929) or the caller per call (#3946); all three end in the same
finish_window_observationdecision, andset_valuebypasses it in every one but ours. One internalPostActionObservationresolved from the reserved flag and the host environment, consulted by every action, defaults unchanged, is a smaller diff than any of the three. On provenance: our fork carriesChanges::polled(window_change_detector.rs,Changes::not_polled()), so a declined poll cannot be read as "no change observed"; it is not in #3946 yet and belongs in this slice. -
Agreed. The public field is a contract change and our ledger already had it as RFC-gated. #3946 drops the
detect_window_changeschema entries and the regenerated contract, manifest, Python and TypeScript bindings; keeps theset_valuerouting, thepolledprovenance, the decision tests re-expressed over the internal policy, and the measurements as evidence. The public shape goes to the RFC. -
Agreed; #3946 never touched the 800 ms settle and will not.
Next action: #3946 is re-cut as the seam PR in 1 and 2 (same number, new title) and its head goes on that thread. The #3488 and #3929 parser and propagation tests fit in it if their authors want them carried.
One data point for the Changes::not_polled() distinction @will-bogusz raised — the latency case here is already well measured, so this is only about what goes wrong when a caller cannot tell "not observed" from "no change".
Same stack as the original report: cua-driver 0.28.2, macOS 26.5.1, Jev choosing, Cua Driver executing over AX in the background. Task: 6 × 7 = on Calculator. I ran it twice on the same window, differing only in whether the caller could see the display text. (It can't through structuredContent.elements — that is #2958 — so the second run recovers it from tree_markdown.)
| caller can see the result | outcome | steps | display afterwards |
|---|---|---|---|
| no | stopped by the caller's stall detector | 7 | 294×7 = 2,058 |
| yes | done | 5 | 6×7 = 42 |
The blind run did not just miss the success. Having seen no change, it kept choosing =, and on Calculator a repeated = repeats the last operation: 42 → 294 → 2,058. It overwrote a correct result, and every one of those clicks reported "effect": "unverifiable".
The cause there is the observation projection, not a skipped poll, but the caller's failure is the same one: it read an absence of evidence as an absence of effect, and re-dispatched an action that was not idempotent. That is exactly what returning Changes::no_change() from a declined poll would invite, and why observation: skipped needs to be distinguishable from observation: confirmed-no-change on the wire — not only inside the driver.
Nice example. The real bug: the agent saw nothing change, assumed nothing happened, and pressed = again — which broke a correct answer. That guess shouldn't be the model's job. The driver should just say plainly "I didn't check" instead of "nothing changed."
But note: here the agent couldn't see the result at all (#2958). So even a clear "I didn't check" wouldn't save it — there was nothing to look at.
So two fixes needed:
- Never call a skipped check "no change."
- Fix #2958 so the result is actually visible to check.
One keeps the driver honest, the other gives it something to be honest about.
Agreed on both, and a re-run adds a detail to your first point.
In that run the driver never said "no change". Every click returned "effect": "unverifiable" — but so did the four clicks that visibly worked in the sighted run. On this surface the field is constant, so an honest "I didn't check" couldn't single out the harmful press. The "nothing happened" was my loop's inference from a view that couldn't show the display. Which is your point 2: honesty only helps a caller that has some other way to look.
I also tried the caller-side rule this suggests — never repeat an unverifiable action on the same target when nothing visibly changed. Same blind setup, real hardware:
| stopped by | display afterwards | |
|---|---|---|
| before | stall detector, step 7 | 294×7 = 2,058 |
| with the rule | the rule, step 6 | 42×7 = 294 |
It caught the second repeat, not the first. After the first =, the clear key's label flips from C to AC, and "something in the window changed" got read as "the action took effect". A caller can only diff the whole window, not the effect it cares about.
So a caller-side guard reduces the damage but can't stand in for either fix. When the display is visible — here via text recovered from tree_markdown, standing in for #2958 — the same loop stops at 42 in 5 steps.
Independent measurements for the post-action poll, as promised on #4055. They cover two points on this thread: the latency cost, and the fact that a caller cannot tell "not polled" from "no change".
Setup: Apple M3 Pro, macOS 15.5, Chrome 153 (isolated profile, --force-renderer-accessibility), local fixture page. Two release builds: main at 1c6932f (0.28.4) and #3946 at f3ccc1b. Direct-mode MCP; client-side round trip; 10 reps per cell, conditions shuffled per rep within one driver process.
| action | main default |
main + _skip_window_change_detection over MCP |
#3946 default | #3946 detect_window_change: false |
|---|---|---|---|---|
click (AX element) |
1,112 ms | 1,129 ms | 1,128 ms | 83 ms |
set_value |
1,109 ms | 1,119 ms | 1,118 ms | 82 ms |
type_text (1 char) |
1,147 ms | 1,148 ms | 1,134 ms | 94 ms |
press_key (end) |
1,174 ms | 1,174 ms | 1,158 ms | 122 ms |
scroll (1 line) |
1,195 ms | 1,194 ms | 1,192 ms | 167 ms |
Medians. p90s follow the same pattern.
- The reserved flag is still unreachable on
main. Sending it over MCP changes nothing, which matchessanitize_reserved_argsdropping underscore-prefixed keys. - With #3946, declining the poll removes about 1.0–1.05 s from every action above. The default is unchanged.
- "Not polled" and "no change" look the same. A fixture button calls
window.open. Over 5 reps each, the popup opened every time. With the poll on, every response included🪟 Action opened new window(s). Withdetect_window_change: false, no response mentioned it. In both casesstructuredContentwas identical:{"delivery":{"mode":"background"},"effect":"unverifiable","route":"accessibility"}. A caller that declines the poll gets a response it cannot tell apart from "nothing opened". This is evidence for anot_polledmarker (or equivalent) if the opt-out ships.
hotkey is left out of the table. On main it failed on this fixture (focus pixel-click ... failed, escalation delivery_failed), so the columns are not comparable.
— sent via Glean Tau