feat: add a daemon command to stop the current utterance#41
Merged
Conversation
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
stopshuts the whole daemon down (forcing a ~2s model reload on the next call), so there was no way to interrupt a long read without paying that cost — and on-demand callers (speaklast, stack-nudge) had no "shush" at all. Add acancelcommand that stops the current utterance and drops the queue while leaving the daemon running.Changes
{"command": "cancel"}daemon request →_DaemonState.cancel()drains the queue and aborts the in-flight playback via the engine's existingStackvox.stop().daemon.cancel()client helper.stackvox cancelCLI subcommand — distinct fromstop, which shuts the daemon down.No change to the model, playback engine, or existing commands.
Testing
pytest— adds a protocol test (cancelrepliesok, aborts playback via the mocked engine, and the daemon stays up — a follow-uppingstill returnsok) and a CLI handler test; full suite green (194).ruff check ./ruff format --check .clean.Related issues
Consumers that send this to interrupt a read without a daemon restart:
stackone-speaklast'sspeaklast --stop, and a stack-nudge "speak selection" hotkey's stop. Both degrade to a no-op against daemons older than this.