Repository navigation
#187 (part 1): paste answers by stage, never a blind retry, with value-free diagnostics - #254
Merged
Merged
Conversation
…diagnostics (refs #187) The paste route's two waits no longer share the vendor's read sentence: - no read in time stays clipboardReadTimedOut; a read with no effect seen is the new pasteUnconfirmed, an error. A moved change count is still the conflict for both. - both sentences say delivery is unknown and to observe the field with get_app_state before any retry, never blindly; type_text's add the confirmed units and lines and that the failed line's state is unknown. - no confirmation channel (empty baseline and no trusted notification source) answers pasteUnconfirmed at once after the read. A Chromium or Electron observer is trusted only while #244's enablement holds for the process (WebAccessibility.enablementHolds). - both waits end at the request's deadline too, with that stage's error. - every paste records meta.paste (cua/paste): which wait ended it and how, the read's signed time against the Cmd-V post, the main thread's lag, the restore outcome, the notification source, an empty baseline, and the 3a predicate keyFocusAtPaste with its inputs, recorded only. Sminos-Session: cursor235#b93055dd (cua on macbook)
…no-channel rule, diagnostics and deadline (refs #187) Names the departure from the vendor's single sentence (FUN_1001b534c remaps the effect timeout to the read sentence), the new pasteUnconfirmed, the two texts, the no-channel rule with #244's trust condition for Chromium and Electron, the value-free diagnostics with the record-only keyFocusAtPaste predicate (refusal after a live slot), and the deadline binding. Design's Paste paragraph and Interfaces' meta and error names follow. Sminos-Session: cursor235#b93055dd (cua on macbook)
…irmed note (refs #187) The design session's refinement of rule 4: "no channel" (cua can't look) is not "looked and saw nothing". - empty baseline and no trusted notification source, first hand-over at or after the Cmd-V post: success, meta.paste.confirmed false with the stage, and the result's note ("Pasted, unconfirmed: ..."), which the service adds to the tool result's content with nodeRepl.emitContentItem (the facade returns nothing of an input's result to model code). - type_text goes on to the next line; its note counts them ("3 lines pasted, 1 unconfirmed: ..."), and a later line's error says how many of the complete lines were unconfirmed. - the only read before Cmd-V (a foreign reader): pasteUnconfirmed. - a channel and no change, and no read at all: unchanged. The Decision Log entry, Design's Paste sentence and Interfaces follow. Sminos-Session: cursor235#b93055dd (cua on macbook)
#187, review P2) Each of effectReading's three AX requests takes the effect wait's time left as its messaging timeout (boundedMessagingTimeout: at most 1 s, at least 50 ms, the rule the observation's deadlineBounded already used), none is sent once the time is spent, and the application element's usual timeout is put back after. A changed reading that came back after the time ran out is no longer accepted, so a slow target's late reply answers pasteUnconfirmed instead of confirming a line and moving multi-line typing on. Regression: a read that itself uses up the remaining time. Sminos-Session: cursor235#b93055dd (cua on macbook)
…the first read (refs #187, re-review P2) Each representation of an item (HTML, RTF, plain) is handed over on its own, so a clipboard manager taking the plain text before Cmd-V and the target taking the HTML after it are two hand-overs. PasteEffect now keeps, beside the first hand-over's time (readAfterPostMs, diagnostics), the first at or after the Cmd-V post (firstReadAfterPostMs), and the no-channel success or pasteUnconfirmed decision keys on that. Regression: several representations, one read before Cmd-V and another after. Sminos-Session: cursor235#b93055dd (cua on macbook)
#187) Sminos-Session: cursor235#b93055dd (cua on macbook)
Codex Review SummaryThis 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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
SSFSKIM
added a commit
that referenced
this pull request
Nov 1, 2026
…71-m3 Main moved again: #254 (#187 part 1, the macOS paste route: answers by stage, never a blind retry, value-free diagnostics). The overlapping files and how each was resolved: - .claude-plugin/plugin.json, marketplace.json (conflict): this branch's 0.21.0 kept, still the next minor above main's 0.20.5. No other file overlaps. #254 touches the macOS engine (native/engine/), scripts/native-matrix/, its spec, and src/services/engine/service.mjs, the macOS engine service, additively (it acts only on a `note` the engine sends on paste or type_text, or a `paste` meta key, which cua-engine never sends). Nothing under native/linux-engine/, scripts/linux-engine-diff/ or src/services/engine/linux/ changes. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
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.
Summary
When cua types through the clipboard (
type_textunder a non-layout input source such as Korean 2-Set, andpaste), every failure answered one sentence: "Timed out waiting for the application to read the clipboard". That sentence covered three different things:The last case often means the text did arrive, and a model that retried blindly typed it twice (MAWS dogfood). OpenAI's helper has the same flaw: it remaps its effect timeout to the read-timeout sentence (
FUN_1001b534c).This PR makes the answer honest about which stage failed, and tells the model to look before any retry. It doesn't yet make background Chrome take the paste; that needs a live A/B, planned below. Refs #187 (not Closes: #187's criterion is that those rows deliver).
What changes (
native/engine/Sources/Engine/Paste.swift,Pasteboard.swift,Enablement.swift,Input.swift;src/services/engine/service.mjs)Answers by stage:
clipboardReadTimedOut: "Timed out waiting for the application to read the clipboard: ⌘V was sent, but no app read the pasted text in time. Whether anything was entered is unknown: observe the field with get_app_state before any retry, and never retry blindly."pasteUnconfirmed(new): "The paste could not be confirmed: ⌘V was sent and the pasted text was read from the clipboard, but no change was seen in the field. The text may have arrived: observe the field with get_app_state before any retry, and never retry blindly."pasteUnconfirmed_metagetsconfirmed: falseand the stage. This replaces the vendor's blind 100 ms success with a success that says it is unconfirmed, gated on the read's timing.clipboardConflict, as beforetype_textputs its progress in the error text, since the model doesn't read_meta: e.g. "Confirmed entered: 3 of 8 characters (1 of 3 lines complete); line 2 is in an unknown state." Unconfirmed-success lines continue, and the final text counts them ("3 lines pasted, 1 unconfirmed…").SelectedTextChanged/ValueChangedfrom a Chromium or Electron process (principal classBrowserCrApplication/AtomApplication) count only while macOS engine: the first observation of a freshly enabled Chromium/Electron app returns an incomplete tree (vendor's is complete) #244's web-accessibility enablement holds for that process (WebAccessibility.enablementHolds). Basic mode from the role read alone doesn't make them send.deadlinerecorded.cua/pastein the response meta, value-free, with no clipboard or field contents):restored/skippedChanged/notTaken);keyFocusAtPaste, with its inputs: is the app frontmost, or is the key-focus process the app's or the keys' target's, and is the app's focused element in the window route 3 prepared? It is record-only here: it never refuses. Refusal on it waits for the slot to show it separates delivered rows from undelivered ones.Limits
SyntheticAppFocusEnforcer.safelyEnforceActiveStateandtargetForKeyboardEventbefore ⌘V. Fixing that (3b) needs the attended A/B; if it fails, 3a's refusal ends Fix Chrome background paste clipboard-read timeouts in composing@textedit rows #187 as a stated gap.keyFocusAtPasteis a heuristic. Its value on real apps is unvalidated until the slot.Tests
runPaste,PasteEffect(fake clock),TestPasteboardandPasteboardAccessseams. Covered:enablementHolds.test/services-engine-service.test.mjs(the note and the error text pass to the model unchanged;cua/pasteper call).pasteUnconfirmed. Fixed in e252884: the decision keys on any handover at or after ⌘V (firstReadAfterPostMs), with a regression test. I verified the two-line decision change myself.ci-gateon ce64855 GREEN: sandbox-live, plugin, engine-swift and test (run 41304301404). The PR's own checks are green (run 41304289990).Docs
Native-engine design spec: a Decision Log entry (#187, 2026-11-01) for the stage split, the text contract, the departure from the vendor's single sentence, the no-channel rule with the #244 trust condition and the read-timing gate, the diagnostics with the record-only 3a predicate, and the deadline binding. The Design "Paste" paragraph and the Interfaces meta and error lists are updated to match.
Plugin 0.20.5 (its own commit).
Refs #187
Sminos-Session: cursor235#b93055dd (cua on macbook)