fix(windows): buffer streaming SendInput events#502
Merged
H-Chris233 merged 1 commit intoMay 19, 2026
Conversation
PR Reviewer Guide 🔍(Review updated until commit 52ea7f5)Here are some key observations to aid the review process:
|
e7d4a38 to
52ea7f5
Compare
|
Persistent review updated to latest commit 52ea7f5 |
appergb
pushed a commit
that referenced
this pull request
May 19, 2026
…lush 合并 #502(fix(windows): buffer streaming SendInput events): SSE delta 在 12ms 时间窗内合并后再调用 type_unicode_chunk, 显著降低 Windows 流式输入路径上的 SendInput 调用频率与 CPU 占用。 mpsc 由 tokio unbounded 切到 std sync::mpsc,typer 任务里 用 recv_timeout 实现 flush 窗口,断开/失败后仍能 drain 完剩余 delta, 并把缓冲写入逻辑抽到 flush_streaming_insert_buffer 单元函数。 本次只动版本号,逻辑改动已在 #502 落盘。
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.
User description
Summary
Diagnosis
Issue #491 logs show visible stalls on the Windows
streaming_insertpath after ASR/LLM work completes. The likely cause is rapid UnicodeSendInputdelivery overwhelming foreground apps such as Chromium, VSCode, Notepad3, or Explorer.Fix
Instead of sleeping after every character, the typer now accumulates SSE deltas into a small buffer and flushes the current buffer every 12ms. This avoids 500-character transcripts gaining ~6s of artificial delay while still pacing output bursts.
Validation
git diff --checkcargo test --manifest-path "/home/chris233/openless/openless-all/app/src-tauri/Cargo.toml" streaming_insert -- --test-threads=1cargo test --manifest-path "/home/chris233/openless/openless-all/app/src-tauri/Cargo.toml" unicode_keystroke -- --test-threads=1Follow-up
Refs #491
PR Type
Bug fix
Description
Batch streaming deltas every 12ms
Remove Windows per-character input delay
Reduce post-dictation UI stalls
Preserve typed text on failures
Diagram Walkthrough
File Walkthrough
dictation.rs
Batch streaming deltas before typingopenless-all/app/src-tauri/src/coordinator/dictation.rs
mpscunicode_keystroke.rs
Remove Windows keystroke pacing delayopenless-all/app/src-tauri/src/unicode_keystroke.rs
SendInputdelivery fully synchronous