fix: cancel in-flight work when hiding the overlay#72
Closed
quiet-node wants to merge 2 commits intomainfrom
Closed
fix: cancel in-flight work when hiding the overlay#72quiet-node wants to merge 2 commits intomainfrom
quiet-node wants to merge 2 commits intomainfrom
Conversation
Hiding the overlay (double-tap Control, Escape, Cmd+W, or X button) now cancels any active Ollama streaming, image processing, or screen capture. Previously these operations continued running in the background after hide, which could cause stale responses to appear on next activation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
The cancel() call in requestHideOverlay is fire-and-forget (async, not awaited). When the user quickly reopens the overlay, replayEntranceAnimation calls reset() which clears all messages. But the old channel's onmessage callback still holds references to the same React state setters. When the Cancelled chunk (or late tokens) arrive, they re-populate the cleared state, causing the previous session's text to reappear. Fix: add an epoch counter to useOllama, mirroring the backend's epoch pattern in ConversationHistory. Each reset() bumps the epoch. The channel callback snapshots the epoch at generation start and bails out if a reset has occurred since then. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
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.
Summary
cancel()and clearing pending submit/message state inrequestHideOverlayso that hiding the overlay (via double-tap Control, Escape, Cmd+W, or X button) stops any active Ollama streaming, image processing, or screen captureTest plan
validate-buildpasses (lint + format + typecheck + build)🤖 Generated with Claude Code