Skip to content

[Windows][insertion] Clipboard Paste mode fails with clipboard ownership changed #1524

In review

Description

@HKLHaoBin

摘要 / Summary

在 Windows 上,将通用设置中的 Windows 插入方式 设为 Clipboard Paste(剪贴板粘贴) 后,听写结果会反复插入失败;同一环境下切换到 TSF 或 SendInput(逐字模拟) 可以正常插入。

这看起来不是 ASR 或润色失败:失败会发生在最终文本已经产生之后的 Windows clipboard/paste delivery 阶段。

Environment

  • Windows desktop build; the exact product version/commit is not printed in the supplied log.
  • The log contains build_id=33618fae405179f916c0c50d6de53b23f81b7f45 and protocol_revision=0x4F4C0009 in the TSF comparison run.
  • Upstream beta was checked at 29d6e49321008d9a1f81821bdcbee34b9431d351 while preparing this report.
  • The log does not record which PasteShortcut was selected (Ctrl+V, Ctrl+Shift+V, or Shift+Insert) or the exact foreground application name.

Reproduction

  1. Open OpenLess settings and set the Windows insertion method to Clipboard Paste.
  2. Focus an editable text field.
  3. Trigger dictation and let it finish.
  4. Repeat the operation several times.
  5. Switch only the insertion method to SendInput or TSF and repeat; those modes insert successfully in the same captured run.

Evidence from the supplied log

The supplied log is openless-2026-12-01T04-48-52.log (18,478 lines). In the repeated reproduction window on December 1, 2026, 04:47:10Z–05:07:33Z, the following pattern appears:

  • Nine Paste sessions end with operation=insert_final result=Err(Platform) followed by Tauri text insertion failed. Examples: lines 16872, 17038, 17093, 17147, 17206, 17265, 17324, 17440, and 17674.
  • The failed sessions are explicitly preceded by TSF composition disabled mode=Paste. For example, session 39d7c030-12f8-49b5-84b7-54be463891d6 reaches final text at lines 17318–17323, then fails at lines 17324–17327.
  • The same run succeeds with SendInput: session c56659c2-86a8-4f56-acc8-4d641d5513f8 logs mode=SendInput at line 17377 and result=Ok(Inserted) at line 17388. Later SendInput sessions also complete with Ok(Inserted).
  • The same run succeeds with TSF: session 7d7b954e-910e-4ed4-ad63-24f30ec011c6 logs mode=Tsf at line 17484 and result=Ok(Inserted) at line 17520.
  • Around the failing Paste attempts, the log also contains repeated warnings such as clipboard write failed: clipboard ownership changed (lines 17328–17335). The full log contains 11 occurrences of that warning.

Source-level correlation

I checked the current upstream beta source at 29d6e49321008d9a1f81821bdcbee34b9431d351:

The closest source-level explanation is therefore a clipboard ownership/receipt check failing between OpenLess's write and its pre-paste validation. A Windows clipboard history component, third-party clipboard manager, another clipboard writer, or a race in the ownership check could change the sequence/marker. The log does not identify which process changed the clipboard, so this is a likely trigger rather than a confirmed external culprit.

One important behavior follows from the current code: when this ownership check fails, the Paste path returns the generic Platform error before sending the paste shortcut; it does not fall back to the working SendInput path. The clipboard_delivery lock and the 750 ms post-paste consumption window do not prevent an external process from changing the clipboard before this pre-paste ownership check.

The ownership/receipt path was introduced in commit 7cf35ff1d95a8e0f4e6005c14b0e209d97b8f1f3. I am not claiming that commit is definitively the regression; it is the first source seam that matches the observed clipboard ownership changed failure.

Expected behavior

Clipboard Paste should insert the recognized final text into the focused editor, or report a distinct, actionable clipboard-delivery failure. TSF and SendInput working in the same run suggests the failure is specific to the clipboard paste path.

Request

Please investigate whether the owned-clipboard sequence/marker check can reject normal Windows Paste delivery under Windows clipboard history or clipboard-manager activity, and why this path becomes a generic Tauri text insertion failed without a safe fallback or more specific diagnostic.

This is a report only; no fix is requested in this issue.

Related issues

Activity

  1. HKLHaoBin commented on Dec 1, 2026

    @HKLHaoBin
    CollaboratorAuthor

    Android artifact available for testing

    The Android artifact for the reviewed fix is ready from commit d2180528c16ff0e563d6cb5d99fdc43717aff3ce.

    This is the requested Android build and does not exercise the Windows Clipboard Paste path from this issue. The desktop artifact is still building; please use the desktop artifact for reproducing #1524.

  2. HKLHaoBin commented on Dec 1, 2026

    @HKLHaoBin
    CollaboratorAuthor

    Windows desktop artifact available for #1524 testing

    The Windows desktop artifact for the reviewed fix is ready from commit d2180528c16ff0e563d6cb5d99fdc43717aff3ce.

    The bundled provenance records source SHA d2180528c16ff0e563d6cb5d99fdc43717aff3ce, run 46598109687, and ref fix/issue-1524-clipboard-paste-ownership.

    Please install this build, set the Windows insertion method to Clipboard Paste, and repeat the scenario from this issue. If possible, also compare with TSF and SendInput in the same environment. The Intel macOS job in the same desktop workflow is still running; this Windows artifact is already available for the reported Windows problem.

  3. HKLHaoBin commented on Dec 1, 2026

    @HKLHaoBin
    CollaboratorAuthor

    Desktop artifact matrix complete

    The exact-head desktop workflow has now completed successfully for commit d2180528c16ff0e563d6cb5d99fdc43717aff3ce.

    Artifacts verified from the same run:

    Please test the Windows installer first for the Clipboard Paste issue. The macOS artifacts are provided for the requested desktop matrix but do not exercise the Windows-specific path.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions