Skip to content

fix(windows): keep the dictation on the clipboard when Windows blocks the paste, and say so in a notice - #2977

Merged
opencodejr[bot] merged 1 commit into
devfrom
agent/issue-2975
Nov 27, 2026
Merged

opencodejr[bot] merged 1 commit into
devfrom
agent/issue-2975

Conversation

@opencodejr

@opencodejr opencodejr Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Fixes #2975.

Problem: when SendInput rejects Hex's Ctrl+V chord, the paste failed with "an elevated target window may reject input". @Dylanx01 found the real cause on their PC: 360 Total Security blocks Hex's simulated input, and the paste fails the same way in non-elevated Notepad and Electron windows. The failure also restored the previous clipboard, so the transcript was gone and could not be pasted by hand. The message only appeared with Labs › Failure notices on.

Change:

  • src/windows/paste.rs: a rejected paste chord cancels the pending clipboard restore (ClipboardRestore::keep, as the shell-target fallback already does), so the transcript stays on the clipboard. The job still fails with the error tone. The error is now crate::paste::WINDOWS_PASTE_BLOCKED, and the sent/total counts go to a tracing::warn!. The YOLO Return failure is now a short "Windows blocked Hex's Return key" with its counts in the log too.
  • src/paste.rs: adds WINDOWS_PASTE_BLOCKED ("Windows blocked Hex's paste. Your words are on the clipboard: press Ctrl+V. Security software or an app running as administrator can cause this.") and blocked_by_windows, next to POST_EVENT_REFUSED.
  • src/rune_ui/live_text.rs: notifies_with shows the blocked Windows paste even with Labs › Failure notices off, as it does for the macOS refused paste.
  • src/desktop/activity.rs: failure_explanation translates it via desktop::i18n::tr.
  • i18n: the string is added to failures.rs (pl, zh, ja, de, es, uk) and to the French, Russian, Hungarian and Portuguese tables. Traditional Chinese is derived from the Simplified Chinese string.
  • docs/features/dictation.md: the Windows paste map documents the blocked-chord path and that the notice shows with Failure notices off, and names the tests that cover it.

Credit to @Dylanx01 for the diagnosis: other processes could still inject input, and disabling 360 made pastes work again.

Tests: new assertions in a_refused_paste_is_shown_with_failure_notices_off (live_text.rs) and known_microphone_failures_get_an_actionable_explanation (activity.rs), plus a new the_blocked_windows_paste_notice_has_every_language (i18n.rs).

Not verified: this environment has no Rust toolchain, so the change has not been compiled, run through clippy, or tested, and it needs a build (ideally on Windows) before merging. Only python3 scripts/code-shape.py --check was run, and it passes. Not exercised on a real Windows PC with security software.

Fixes #2975

@opencodejr
opencodejr Bot merged commit 4cbfd33 into dev Nov 27, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: paste always fails with 'synthetic paste events' error when 360 Total Security is active (misleading elevated-window message)

0 participants