Skip to content

macOS engine: a Cmd-V handled after the clipboard restore would paste the person's previous clipboard #256

Open

Description

@SSFSKIM

Problem & intent

On the macOS engine's paste route (paste, and type_text under a non-layout input source such as Korean 2-Set), cua puts the text on the general pasteboard, posts ⌘V, waits for the read (2 s) and the effect (2 s), then restores the person's previous clipboard, guarded by the change count. If the target app handles that ⌘V only after the restore (a busy main thread, a renderer catching up), it pastes the person's previous clipboard contents into the app. Not observed. The code allows it, and OpenAI's helper shares it: its restore (FUN_1001b7490) has no grace period for a late read.

Intent: a late ⌘V must never deliver the person's own clipboard into the driven app, without leaving the agent's text on the clipboard longer than needed.

Seams: native/engine/Sources/Engine/Paste.swift, native/engine/Sources/Engine/Pasteboard.swift.

Constraints

Success criteria

  • A measured answer to whether a ⌘V can be handled after the restore on the scenes (TextEdit, Chrome for Testing, the Electron fixture), using #187 (part 1): paste answers by stage, never a blind retry, with value-free diagnostics #254's cua/paste diagnostics (the read's time against ⌘V, the restore outcome).
  • If it can: a design that prevents the person's clipboard reaching the app (candidates to weigh: restore after a short grace only when no read came, or a placeholder item until the grace ends), with its cost in time the agent's text stays on the clipboard.
  • If it can't on any scene: a Decision Log line that closes this with the evidence.

Open questions

Is a grace period worth its cost, given the restore also protects the person's clipboard from the agent's text?

Decision log

Sources

Activity

  1. added
    bug
    status:ready-for-architect
    priority:P3
    on Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority:P3status:ready-for-architect

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions