Skip to content

Respect context cancellation in Piper subprocess streaming#13

Open
phyceClaw wants to merge 1 commit into
phyce:python-integrationfrom
phyceClaw:fix/piper-ctx-cancel
Open

Respect context cancellation in Piper subprocess streaming#13
phyceClaw wants to merge 1 commit into
phyce:python-integrationfrom
phyceClaw:fix/piper-ctx-cancel

Conversation

@phyceClaw

Copy link
Copy Markdown

Summary

On the python-integration branch, piper.Synthesize forwarded ctx only in native mode. The subprocess streamUtterance path blocked on sentinel/stderrClosed with no cancellation, so a stuck piper process could not be cancelled when a session was superseded (only playback unblocked).

The blocking waits now select on ctx.Done() and abandon the in-flight utterance cleanly on cancellation, matching how the Python engine already handles ctx.

Testing

go test -race ./app/tts/engine/piper/... ./app/common/audio/... passes (skips noted where a piper binary/model is unavailable).

🤖 Generated with Claude Code

Synthesize forwarded ctx only in native mode; the subprocess
streamUtterance path blocked on sentinel/stderrClosed with no
cancellation, so a stuck piper process could not be cancelled on
session supersession. Select on ctx.Done() in the blocking waits and
abandon the in-flight utterance cleanly on cancel.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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