fix(tui): harden paste-burst state transitions#9124
Merged
joshka-oai merged 1 commit intomainfrom Jan 14, 2026
Merged
Conversation
3b57330 to
f8b8fae
Compare
b504bed to
1ca7c58
Compare
dylan-hurd-oai
approved these changes
Jan 13, 2026
Collaborator
dylan-hurd-oai
left a comment
There was a problem hiding this comment.
Thanks for the cleanup here!
User-facing symptom: On terminals that deliver pastes as rapid KeyCode::Char/Enter streams (notably Windows), paste-burst transient state can leak into the next input. Users can see Enter insert a newline when they meant to submit, or see characters appear late / handled through the wrong path. System problem: PasteBurst is time-based. Clearing only the classification window (e.g. via clear_window_after_non_char()) can erase last_plain_char_time without emitting buffered text. If a buffer is still non-empty after that, flush_if_due() no longer has a timeout clock to flush against, so the buffer can get "stuck" until another plain char arrives. This was surfaced while adding deterministic regression tests for paste-burst behavior. Fix: when disabling burst detection, defuse any in-flight burst state: flush held/buffered text through handle_paste() (so it follows normal paste integration), then clear timing and Enter suppression. Document the rationale inline and update docs/tui-chat-composer.md so "disable_paste_burst" matches the actual behavior.
f8b8fae to
2c24c0c
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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-facing symptom: On terminals that deliver pastes as rapid
KeyCode::Char/Enter streams (notably Windows), paste-burst transient state
can leak into the next input. Users can see Enter insert a newline when
they meant to submit, or see characters appear late / handled through the
wrong path.
System problem: PasteBurst is time-based. Clearing only the
classification window (e.g. via clear_window_after_non_char()) can erase
last_plain_char_time without emitting buffered text. If a buffer is still
non-empty after that, flush_if_due() no longer has a timeout clock to
flush against, so the buffer can get "stuck" until another plain char
arrives.
This was surfaced while adding deterministic regression tests for
paste-burst behavior.
Fix: when disabling burst detection, defuse any in-flight burst state:
flush held/buffered text through handle_paste() (so it follows normal
paste integration), then clear timing and Enter suppression.
Document the rationale inline and update docs/tui-chat-composer.md so
"disable_paste_burst" matches the actual behavior.