fix(livekit): preserve client pause intent across TTS playback - #1
fix(livekit): preserve client pause intent across TTS playback#1ctaylor86 wants to merge 2 commits into
Conversation
External contribution triageThis PR separates explicit client pause state (`_client_paused`) from TTS echo-suppression state (`_paused`), applies both gates to audio receipt and silence polling, and clears client pause intent when a room session is torn down. The supplied tests cover streaming and whole-file TTS completion, interruption, replacement, cancellation, reconnect, and leave/rejoin behavior. No concrete correctness or security regression is evident in the supplied diff. The reported full suite is not green, but the five failures are stated to reproduce on the unmodified base. Reviewed commit: Code coverage: 2 of 2 changed files; static review only. Contributed code was not executed. No actionable code findings were identified in the reviewed changes. This is not an approval or a guarantee that the changes are correct. Coverage limits: Full-file context exceeded the review budget: hermes_livekit/adapter.py; Full-file context exceeded the review budget: tests/test_streaming_tts.py; Credential-like source strings were redacted before cloud analysis. A maintainer decides next steps. This automation does not fix code, close items, approve, or merge changes. |
|
@ctaylor86 sorry about the slow response, this PR got lost in all the noise on Github. I've updated my external contributions management system, so hopefully won't drop things in the cracks anymore. |
|
Thanks for this contribution. Since it was opened, Could you update the PR to build on the existing shared sink, focusing on preserving client pause/resume intent and adding regression tests for that behavior? Please retain the current source-ownership and cancellation safeguards. The original implementation also has two ownership issues: stale finish cleanup can clear a replacement reply, and declining an overlapping stream permits whole-file fallback to compete for the same source. |
Adapt the residual client pause/resume behavior from PR kortexa-ai#1, commit 2e064ab, onto the existing shared streaming sink. Keep playback ownership and cancellation unchanged.
2e064ab to
f397946
Compare
|
Thanks for the direction. Reworked this on current main using the existing shared sink, limited to client pause/resume intent and regression tests. The new head is f397946. All 18 pause regressions pass, including full leave/rejoin and same-session reconnect; independent review found no new blockers. The full suite has 524 passes and the same five host-integration failures seen on the unmodified base (detailed in the updated description). Source ownership and cancellation safeguards are unchanged. The existing shared-sink speaking-start publication lock remains a separate limitation, not something this patch claims to fix. |
Summary
Reworked on current
main(a6bd9a5d7a84e54e84894801128f60df8dade3c2) as requested. Reuses the existing shared streaming sink rather than retaining the original parallel streaming implementation.Only
hermes_livekit/adapter.pyandtests/test_streaming_tts.pychange. Shared sink, resampler, source ownership and cancellation safeguards remain unchanged.Verification
Candidate:
f39794693ed45ef4a17ce6ae725a12c5f6792fe0.git diff --checkpassed. No hardware/provider canaries were run.Tests use isolated Python 3.11 with plugin dev dependencies and unmodified editable Hermes main
d4d4ecfae0c135b7bb52ff4f782ffef17bbc90c7. Plain PyPI installation could not resolve the declaredhermes-agent>=0.20.0dependency in the available index.Existing integration failures and limits
The five unchanged failures are quiet-prefix fallback (both transports), incomplete-first-sample fallback (both transports), and long-reply finalizer draining. This is not a fully green host/plugin integration qualification.
The existing shared sink still awaits
output_started()under its lifecycle lock. This narrow pause-intent revision preserves that upstream implementation and does not claim to resolve slow speaking-start publication blocking abort. Capture-frame backpressure cancellation is tested separately.