Repository navigation
Merged
Conversation
…t effect says it may have landed (cua 0.31.3) Rulings 1305 and 1306, sized in #610's pre-flight ("Limits (ruling 1305)", 610-preflight 2ef36e7). On a busy machine a tab Chrome is not showing answers CDP commands at 0.12 s at the median and single ones in seconds; the service's limits, sized for the page, failed actions that were only slow. The page keeps the vendor's numbers (3 s an action, 5 s typing's readiness, 10 s a load); Chrome gets its own, for every tab: - Only the host's own limit detaches. BackendApi asks the host to keep the debugger for every command whose limit it names (a caller's budget, a release, the cap); the host's own limit, 10 s -> 20 s, is the one that detaches. - Readying (attach, setup, a locator action's engine in the top document): 20 s of its own, spent before the action's budget (BrowserSession.ready, run by index.mjs for the commands that drive a page); the attach request is bounded by it. - A locator command already sent when its budget ends is waited for up to 10 s more, with no new attempt (releases and cleanups excepted). - A click's cursor and events: 15 s; the load wait keeps the click's 3 s, begun after the events. - Typing key by key: the field's readiness keeps 5 s, the characters run until the action's cap. - Each action inside a cap: 25 s, or the caller's budget and 22 s (every Deadline made in it ends by then; a call with no budget of its own is bounded by it once tighter than the host's 20 s; nothing is dispatched past it). - Screenshot: 20 s for the whole. goto: its first three commands on the readying's 20 s, the page's 10 s from Page.navigate. Raw CDP: 10 s by default. - Unchanged: the page's and the person's limits, the releases' waits, the cell's 30 s. The sentence (1306): a click, key press, typed key, paste or cut, or Page.navigate that was sent and whose limit ran out says "<what> was sent to the page once and may have taken effect there; it was not sent again." (errors.mjs sentOnce, on the controller's sentCommand mark); reads keep today's wording. The model's guide and the pressSequentially option text say so. The one parity cell holding a number this moves (locator-contracts' click at 10000 ms, "the host's own bound") is declared unchanged. Tests: chrome-time.test.mjs (each limit on a fake clock or the host double, the detach rule through the real host, the readying through the service, the sentences); the tests holding the old numbers updated. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…ed tab (Chrome for Testing 158, Linux) docs/evidence/2026-11-29-chrome-time-623: #610's pre-flight run.sh isolation (run-owned Chrome for Testing 158.0.8127.88, profile and home; Xvfb with openbox, never :0) driving cua's browser service of each tree through its own host and extension. The stand-in for macOS's background band: one burner per core and the hidden tab's renderer run 50 ms of every 2 s; the first press puts the tab in Linux's one frame a second. - Hidden click (each a task of its own): main 2 of 6, ended at 3 s with the move unanswered; #623 6 of 6 in 3.7-3.8 s. - Hidden 10-character pressSequentially: main 0 of 3, ended at 5.5 s; #623 3 of 3 in 18-20 s. - The pages agree (hidden: main 3 clicks and "abc", #623 7 and "abcdefghij"). - The tab that shows: the same commands on both, slowest 23.7 ms, every action under 0.7 s. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…ent beside its own Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…nce and named by its own dispatch The review of 1326898..58e3fe3 (reviewer-high), as the coordinator ruled it (t189-fix1): - P1-1: an effect (input, navigation, or a call carrying `effect`) is sent again only after a refusal proven to come before dispatch: cua's host's "Debugger unattached", and Chrome's "Debugger is not attached to the <tab|target> with id: <id>.", which debugger_api.cc (158.0.8127.88) raises only from InitClientHost, before SendMessageToBackend. "Detached while handling command." and any other wording are not retried, and mark the effect as maybe landed. - P1-2: the client's locator diagnostic is sent with `diagnostic: true`; the service runs it inside a hard cap of its own 1 s, with no readying and no late answer. - P1-3: withinAction answers at its cap (+250 ms to let a command's own sentence through) whatever the work awaits; every backend request in an action is bounded by the cap and none is sent past it (the cursor, a frame's attach). - P1-4: the attach and any re-attach are bounded by the call's budget or the cap; the host's own 20 s or the cap is chosen at the dispatch, from what the cap has left then. - P1-5: the sentence is earned only by the effect's own dispatch: the call carries a fresh identity, the controller marks only that dispatch's failure with it, and errors.mjs sentOnce checks it. A setup call's timeout says nothing. - P2-1: the cap starts before the tab is claimed again. P2-2: a joiner waits for an attachment on its own deadline (the early entry before the attach handlers finish is main's, logged in tech-debt-tracker.md). P2-3: readying installs the engine for the handlers that use it (the DOM snapshot included). P2-4: goto's probes share the action's readying budget with the attach and fail before Page.navigate once it is spent. - P2-5, P2-6, P2-7: a cut's commit and a fill that sets the value itself earn the sentence; a key press names the modifiers sent and that the key was not ("Shift was sent …; Tab was not sent, so Shift+Tab was not pressed."), a double click its first click ("the second was not sent"). - P2-8: a drag's compensating release runs outside the spent cap, on 1 s, keeping the debugger, never attaching. - P2-9, P2-10: the screenshot waits for its lock within its 20 s and never starts once they are spent; a stop after them is a tidy-up of the same kind that holds the lock until it settles while the screenshot answers at once. Tests: chrome-time-bounds.test.mjs (20; 19 red against 58e3fe3 with the new names shimmed, the 20th a guard that holds on both); chrome-time, manifest-docs and the client's diagnostic scenario updated to the new marker and text. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…'s first use (review P3) Run p1's typing trials were warm: the fill that cleared the field ran in the typing's own task, so the tab was attached and the locator engine installed. Run p2 (main 1326898 against #623 756307c) clears it in a task of its own: - Hidden click: main 3 of 6, ended at 3 s; #623 6 of 6 in 3.76-3.80 s. - Hidden 10-character pressSequentially, cold: main 0 of 3, ended at 3 s inside the field's readiness the first use spent; #623 3 of 3 in 22.0 s, inside its 25 s cap. - The tab that shows: the same commands on both, slowest 69.2 ms. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…ic marker (parity-browser at 756307c) ci-gate's parity-browser failed api/browser-playwrightapi/elementinfo's locator-boundary-action-diagnostics on cua's host only: the cell keeps every non-script field of the diagnostic evaluate, and cua's client now sends `diagnostic: true` there (P1-2). The cell's observation leaves out exactly that marker, declared beside it; any other value of the field is kept and fails the contract, and the vendor's wire is unchanged. Test: the exercised cell with the marker observes the vendor's commands; with another value it fails. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…e drag's press released, the screencast filter kept The re-review's six findings to fix (t189-fix2.md): - A fill's evaluation whose execution context is destroyed once it was sent is not tried again, in InjectedScripts.evaluate or the selector poll: it fails evaluate_interrupted carrying its effect, so the fill answers with the "may have taken effect" sentence. A context lost while the engine installs, a context not found (refused before it ran) and the guard's missing helper are still tried again. - A marked effect lost other than by a timeout (a detach) ends the poll with its own code and wording; only a timeout takes the selector's elapsed-budget sentence. - Timers past 2^31 - 1 ms are waited out in steps (whenSpent, the action's bound), a call's timeout stays in the timer's range, and the cap's own timer spends the cap, so nothing is sent after the answer. - A drag releases the button when its press was dispatched and no release was; a release that was dispatched is never sent again. - An internal screencast's frames stay out of the raw queue until its held stop settles; the screenshot's answer is not held back. - The screencast queue's entry is deleted once its last turn is over, a waiter that gave up included. Two ship-with findings logged in tech-debt-tracker.md: a written effect lost with the transport, and modifiers left held by a partly sent key press. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…; a release refused before its write is compensated - InjectedScripts.evaluate: once a marked evaluation (a fill's) was dispatched, any lost context ends it with evaluate_interrupted, "Cannot find context with specified id" included: V8 looks the context up again after the expression and its microtasks ran (v8-runtime-agent-impl.cc at Chrome 158's pinned V8), so "not found" does not prove the fill never ran. The engine's install and the wrapper's missing-helper guard keep their retries. - dragPath: a release refused with the deadline's "before command dispatch" (its budget's last check, before the backend wrote it) is not counted as sent, so the bounded compensating release runs. An uncertain failure after the write is still never replayed. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…ried; a press refused before its write gets no release - InjectedScripts.evaluate inverts the rule: once a marked evaluation (a fill's) was dispatched, every failure is terminal and carries the effect, except a refusal proven to come before the write (cdp.mjs refusedBeforeWrite: "Debugger unattached", Chrome's pre-dispatch "Debugger is not attached to the ... with id", the budget's DEADLINE_EXCEEDED) and the guard's missing helper. A page or context lost (Chrome 158's "Inspected target navigated or closed", JSON-wrapped or not, a context destroyed or not found) is evaluate_interrupted in Chrome's words; any other failure keeps its own code and wording. The selector poll reads the mark on any error, so it never sends the fill again. - sentOnce puts a full stop before the sentence when the message has none, and carries a plain Error's mark as a plain Error. - dragPath: a press refused before its write is not counted as sent, so no compensating release follows it; the release uses the same test. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…eadline's pre-write refusal; the retry and renderer-swap tests
- dragPath: the compensating release after a press is dropped only when
the press failed with its budget's DEADLINE_EXCEEDED ("before command
dispatch"), which proves no mouse-down was posted; on any other
failure the release is kept. The release's own test is unchanged
(cdp.mjs refusedBeforeWrite).
- Tests: a fill whose evaluation is refused before anything ran
("Debugger unattached", Chrome's pre-dispatch wording) is sent twice
and fills, counted through the fill handler; the drag double's press
and release refused after the dispatch hook, by the deadline or as
unattached.
Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…nto 623; cua 0.31.4 Conflicts resolved: - cdp.mjs executeTargetCdp: #620's readyInputFrames runs before an Input.* dispatch on the call's budget or the action's cap (setupOptions(setup)), carrying none of the call's dispatch hooks or its effect; its failures stay swallowed, so a readying failure never carries the effect's mark nor counts as the effect sent. prepareDispatch keeps #623's setup budget. - cdp.mjs ensureAttachedTab's comment: #620's input readying among the setup commands, #623's joiner on its own deadline. - input.mjs clickPoint's comment: #623's budgets and #620's note on events answered one by one. - tech-debt-tracker.md: both sides' entries. After the merge: - cdp.test.mjs's #620 real-host test detached the tab with a caller's 50 ms limit, which #623 no longer lets detach (only the host's own limit does); it now has Chrome take the debugger (addForeignFrame), as #623's detach test does. - chrome-time-bounds: #620's frame readying before an effect's press runs before the dispatch hook and its failure (a stall, a refusal) is swallowed; the press is sent once. - plugin.json and marketplace.json: 0.31.4 (the coordinator allocates the final number). Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…ogged in the tracker (shipped under the last-wave ruling) Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
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.
On a busy Mac, a tab Chrome is not showing (the tab cua opens for an agent, or any tab of a covered or minimized window) answers CDP commands at about 0.12 s at the median, and single commands in seconds (#610's pre-flight). The browser service's limits were sized for the page, so they failed actions there that were only slow. This change gives Chrome time of its own, separate from the page's, on every tab, sized from the measured rows in the pre-flight's "Limits (ruling 1305)" table, as ruling 1306 approved it.
Closes #623
Refs #610
What changes
Page.navigate, and the page's 10 s start atPage.navigate. Raw CDP: 10 s by default.The new sentence (ruling 1306). A click, key press, typed key, paste, cut or its commit, a fill that sets the value itself, or
Page.navigatecan be sent and then lose its answer: it runs out its limit, or the debugger is lost without proof that the command never reached the page. It now fails with "… was sent to the page once and may have taken effect there; it was not sent again." (for example "Character 3 of 6 was sent…", "The click was sent…"). A gesture sent in part names the part: "Shift was sent to the page once and may have taken effect there; Tab was not sent, so Shift+Tab was not pressed." or "The first click of the double click was sent …; the second was not sent." A fill whose evaluation was sent and then lost its page (a date field's change handler navigating: Chrome's "Inspected target navigated or closed", or a context destroyed or not found) failsevaluate_interruptedwith the sentence; one lost with its tab keepstab_detachedand the detach's own wording, and any other failure after the dispatch keeps its own wording, with the sentence. Only the effect's own dispatch earns the sentence; the timeout of a setup call made on its way (a re-attach'sPage.enable) never does. This follows the wordingplaywright.evaluatealready uses. Reads keep today's wording. The model's guide and thepressSequentiallyoption text describe the change.An effect is never sent twice. An input command, a navigation, or an evaluation that changes the page is sent again only after a refusal that proves it never reached the page. Two refusals prove that. cua's host answers "Debugger unattached" before it hands anything on. Chrome answers "Debugger is not attached to the <tab|target> with id: ." only before forwarding:
debugger_api.ccat 158.0.8127.88 raises it only fromInitClientHost, ahead ofSendMessageToBackend. "Detached while handling command." comes after the command was forwarded. A fill's evaluation is never sent again once dispatched, whatever its failure says, short of a refusal proven to come before the write (those two, or its deadline's last check before the backend writes it) or the engine's own missing-helper guard, which refuses before the expression runs. A context lost while the locator engine is installed, before the fill's dispatch, is retried as before. The rule names what may be retried rather than the ways a page can go away: each review found another wording for the latter ("Cannot find context with specified id" comes after the expression ran, since V8 looks the context up again then; "Inspected target navigated or closed" when a navigation swaps the renderer). Reads are retried as before.The worst-case waits
These are the longest an action can take before it fails, in cases where it would otherwise have succeeded slowly.
tab.cua.click({x, y})locator.count(),isVisible(),textContent();getAXState()locator.click()locator.pressSequentially(text)playwright.evaluate(script)tab.screenshot(),getScreenshot(),getAXStateAndScreenshot()tab.goto(url)tab.cdp.send)timeout_msThe cost is the failure case. When Chrome is stuck (a page whose main thread is busy for seconds, or a stuck debugger), the failure now comes after 13 to 25 s, where it came after 3 to 10 s before. Under the pre-flight's harder load, where a fifth of the commands got no answer within 30 s, no limit helps, and these limits make the failure slower.
A tab that shows is untouched. None of these waits apply unless Chrome is slow: in the pre-flight a showing tab answered every command in at most 97 ms, or 632 ms with a frame. In this PR's live runs, the showing tab sent the same commands on main and on this branch. Its slowest command took 69.2 ms, and every action finished in under 0.8 s.
Live proof
docs/evidence/2026-11-29-chrome-time-623/, run p2 (main 1326898 against 756307c). Each tree ran cua's browser service through its own host and extension, on a run-owned Chrome for Testing 158.0.8127.88 with a run-owned profile and home, on a private display. The isolation is the pre-flight'srun.sh. As a stand-in for macOS's background band, there was one CPU burner per core, and the hidden tab's renderer was allowed to run 50 ms of every 2 s. After its first press, the tab is in Linux's one-frame-a-second state. Each measured action ran as a task of its own, so its first command attached the tab again. Each typing was its task's first use of the tab: the field was cleared in a task before it.cua_clickpressSequentially, first useabcdefghijAn earlier run (p1, at 67123c1) had the same clicks and warm typing trials: on those, main typed 0 of 3, ending at 5.5 s, and this branch typed 3 of 3 in 18 to 20 s.
In every hidden click, the attach waits out the host's 1.5 s page guard, because the guard's sweep runs in the starved page. The mouse move then waits up to 2 s for a frame. This stand-in is harsher and more regular than macOS's measured distribution, and the README there says where it differs. A renderer under SCHED_IDLE next to burners only slowed the commands that need its main thread. It never pushed main's click past its limit.
Limits of the evidence
Parity cells
locator-contracts' click attimeoutMs: 10000, whose comment called it "the host's own bound". It is declared unchanged under ruling 1306: the strict-mode violation it expects is still the answer.locator-contracts' boundary diagnostic cell keeps every non-script field of the diagnostic evaluate. cua's client now marks that readdiagnostic: true, so the service can bound it hard at its 1 s. The cell's observation leaves out exactly that marker, declared beside it; any other value of the field still fails.pending-cellsscopes (cua-linux VM Chrome: Input.synthesizeScrollGesture stalls after an ssh-launched Chrome; browser scroll cases pending-environment in #116 M4 #141) hold the vendor host'sTimed out after 10000ms waiting for CDP command Input.synthesizeScrollGesture.. They only validate runs that were already recorded, so they stay as they are.Tests
test/browser-service/chrome-time.test.mjscovers each limit on a fake clock or a host double, the detach rule through the real host, readying through the service, and the sentence for each effect action, with reads keeping their wording.test/browser-service/chrome-time-bounds.test.mjscovers the first review wave: the retry rule for effects, the setup call that must not earn the sentence, the cap over the whole action (the reclaim, backend waits, a slow attach, a late completion), the hard-bounded diagnostic, readying for the snapshot, the joiner's own deadline, goto's shared readying, the partial gestures, the cut's commit, the fill, the drag's release, and the screenshot's lock and stop. Its second-wave tests cover a fill's destroyed context and its detach, a caller's budget past the timer's range and the cap spent by its own timer, the drag's press and release, the screenshot's frames during its stop, and the screencast queue's cleanup.npm teston this VM: the branch fails the tests main fails, plus two download accept tests. Both pass on their own (3 of 3 runs each), and neither touches the browser service.diagnostic: truefield on cua's host; ea0ada9 declares it (decision 8).Three earlier findings are logged in
tech-debt-tracker.mdrather than fixed here:Unresolved Review Findings
The final review of the last wave found no P1. Under the coordinator's last-wave ruling, these ship with this PR and are logged in
tech-debt-tracker.md(e4119d4).src/browser-service/injected.mjs:203-205). If the first fill is refused with "Debugger unattached", the controller retries internally, but the fill'ssentmark stays set from that attempt. If the re-attach itself then fails, the catch marks the setup failure as though the fill reached the page. The reviewer reproduced it through the fill handler: the host refused the first evaluation before running it, then refused to re-attach because debugging had been cancelled. Zero fills ran, yet the error said "The fill was sent to the page once." This is a false warning, never a resend. Fix: clear the mark on a proven refusal before re-attaching, or track the ambiguity at eachexecuteCdpdispatch.src/browser-service/errors.mjs:49).sentOncewraps an unrecognised post-dispatch failure in a new plainError, so the JSON-RPC codeBackend.#dispatchcopied onto it is lost. Fix: copycodewhen present.InjectedScripts.evaluate, and don't poll, so they are never sent twice. But a navigation or context loss there comes back in Chrome's wording alone. This is outside ruling 1306's limit-expiry scope.Merged with #620
main (#628, #620's unbuffered input, cua 0.31.3) is merged into this branch (0c3f19d).
DOM.enableandOverlay.enablerun in the attach path on the readying budget, at 1 to 2 ms each.readyInputFramesruns before anInput.*dispatch, on the call's budget or the action's cap. It carries none of the call's dispatch hooks or its effect, and swallows its own failures, so a frame's readying never counts as the effect sent and never earns the sentence (a test pins this).The plugin moves to 0.31.4; the coordinator assigns the final number at merge.
Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)