Skip to content

feat: add a daemon command to stop the current utterance#41

Merged
StuBehan merged 1 commit into
mainfrom
feat/daemon-cancel
Jul 13, 2026
Merged

feat: add a daemon command to stop the current utterance#41
StuBehan merged 1 commit into
mainfrom
feat/daemon-cancel

Conversation

@StuBehan

@StuBehan StuBehan commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

stop shuts 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 a cancel command 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 existing Stackvox.stop().
  • daemon.cancel() client helper.
  • stackvox cancel CLI subcommand — distinct from stop, which shuts the daemon down.
  • Daemons that predate the command reply with an error, so callers degrade safely (a no-op).

No change to the model, playback engine, or existing commands.

Testing

  • pytest — adds a protocol test (cancel replies ok, aborts playback via the mocked engine, and the daemon stays up — a follow-up ping still returns ok) 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's speaklast --stop, and a stack-nudge "speak selection" hotkey's stop. Both degrade to a no-op against daemons older than this.

@StuBehan StuBehan merged commit 961d181 into main Jul 13, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant