Suppress selectionchange echo in completion pipeline#2228
Merged
curtisman merged 2 commits intomicrosoft:mainfrom Apr 22, 2026
Merged
Suppress selectionchange echo in completion pipeline#2228curtisman merged 2 commits intomicrosoft:mainfrom
curtisman merged 2 commits intomicrosoft:mainfrom
Conversation
Use previousInput to deduplicate selectionchange echoes in the shell's PartialCompletion.update(), preventing the echo from recomputing direction against the already-mutated previousInput (which would flip "backward" to "forward" and corrupt reconcileTypeAhead). Add defense-in-depth dedup in PartialCompletionSession.update() that skips when input+direction are unchanged and the session is active or pending. - Remove lastControllerInput field; reuse previousInput for dedup - Reset previousInput to "" on hide so re-focus re-activates - Add onUpdate debug trace and Playwright tests for update counts - Add unit tests for same-input dedup and direction-change passthrough
- Fix stale 'lastControllerInput' reference in session.ts comment (now correctly references previousInput). - Fix misplaced quote in partial.ts debug log so input is quoted separately from the change-type label. - Add 'update entry:' debug trace at top of PartialCompletion.update() and strengthen Playwright tests to assert the accounting identity entries == content-changed + skipped + hidden, directly verifying the previousInput dedup guard fires.
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.
Suppresses redundant
update()calls in the shell partial completion pipeline that were caused byselectionchangeevents firing after every content mutation, and adds a matching dedup guard in the dispatcher'sPartialCompletionSession.Changes
contentUpdatedflag (which suppressed the next selectionchange after a content mutation) with apreviousInput-based guard. This correctly skips selectionchange echoes without flipping the computed direction (backward→forward) when the input string hasn't actually changed. Reset on hide so re-focus re-activates the controller.inputanddirectionmatch the last call and a session is already active or pending.update entry:,content changed,update skipped:,selection not at end) for clearer tracing.update()entry is accounted for as a content-change, a dedup skip, or a hide.renderDispatchtest for the new "same input + different direction" path.Commits