Repository navigation
Voice: first-come-first-served speech queue, keep endings whole (0.33.0) - #44
Merged
Merged
Conversation
…(0.33.0) - Speakers take a ticket and the oldest live one speaks next; no 120 s give-up, so sessions finishing together are all heard, in order. A turn is dropped only after 15 minutes or when its process died. - macOS mkdir lock is taken over only when its holder is dead, never by age, so long explanations are no longer talked over. - Reply summaries are fetched before waiting for a turn. - A download cut short after its 200 headers is not played. - pad_ms 0 for all but the last piece of long speech. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 24 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (8)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Why
Two reports: voices of several sessions overriding each other when sessions finish at the same time, and the end of the audio being cut off.
Bugs found
Queueing
_ds_voice_with_lockgave up after 120 s (flock -w 120 … || exit 0; the macOS loop after 400 × 0.3 s). Each turn holds the lock for a Gemini summary (up to 10 s) plus the speech itself, so with 3–4 sessions finishing together the later replies were lost without a trace.mkdirlock was taken over when its directory was older than 2 minutes. A long explanation (up to ~3 min) reaches that, so a waiter started speaking on top of it. Reproduced in a test: an old-but-live holder was taken over immediately (waited=0s).speak.shasked for the reply summary inside its turn, so every waiting session also waited on the others' API calls (which made bug 1 worse).flockwakes waiters in no particular order.Endings
5. Partial downloads played.
_ds_voice_server_fetchonly looked at%{http_code}, which arrives with the headers. A transfer cut short by--max-timestill reported200and the truncated WAV was played. Reproduced with a fake curl that exits 28 after a 200.6. No margin at the end for outputs that close the stream early. The server now pads (DowLucas/devscope#92); here every piece but the last asks for
pad_ms: 0, so long speech runs on with no added pauses.What changed
queue/<ns>-<pid>. The oldest ticket whose process is alive speaks next, under the lock, so overlap is impossible. There is no fixed timeout: a turn is dropped only after 15 minutes (DS_VOICE_QUEUE_MAX_WAIT) or if its process died, and dead tickets are pruned.speak.lock.d, and the lock is taken over only when that pid is gone (or no pid appeared within a minute).stopnow removes the directory withrm -rf.200 audio/*; otherwise the fetch is retried, then falls back as before.Testing
tests/voice/run.sh: 166 passed, 0 failed (12 new):DS_VOICE_NO_FLOCK=1).pad_ms: 0on every piece but the last.Against the old scripts (only the test hooks grafted on), the macOS talk-over, the partial download and the padding checks fail as expected. The ordering check fails there too, but because the old code summarised late, not because of
flockorder, so I don't count it as proof of bug 4.Other suites (
agents,errors,hints,queue,recall,usage, hooks consistency) pass.Not changed
Announcements (timer path) still request their sentence inside the turn. They are short, and batching three or more into one sentence keeps that bounded.
🤖 Generated with Claude Code