Repository navigation
Conversation
Correlate new_session acknowledgements by request ID and surface reset failures instead of accepting stale responses. Co-Authored-By: OpenAI Codex <noreply@openai.com>
This was referenced Oct 5, 2026
Owner
|
Thank you @0Downtime. This landed on main through the release-candidate integration in #185 (squash commit — Brett, via Claude Opus 5.5 (AI-assisted) |
BrettKinny
added a commit
that referenced
this pull request
Nov 1, 2026
…voice model (#105, #181) (#204) * fix(pi_voice): skip queued turns when a newer utterance arrived (#105) With the #175 turn lock, room-noise turns queue behind a running reply and are answered late, in order, after the person has moved on. Number each turn per session before it waits for the lock and drop any turn that was overtaken by a later one. Turns with no user words never supersede a real one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(asr): close the session after 3 noise-like turns in a row (#105) A mic left open in a busy room kept feeding TV and podcast audio to the LLM. Level cannot separate that from a quiet child, so count Whisper's own confidence signals (empty/dropped transcript, no_speech >= 0.45, avg_logprob < -1.0) and end the session through the same path as the no-voice timeout when three come in a row. Any real turn resets the run; the setting is configurable and 0 disables it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(pi_voice): pre-warm the voice model when a device connects (#181) The first reply after an idle spell took ~12 s because llama-swap had unloaded the 4B, with the mic open and anything said read as a barge-in. The device WebSocket opening is the earliest signal, so send a one-token request then. Rate limited, fire-and-forget, and a failure is only logged. llama-swap is shared with other services, so its TTL is left alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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
new_session-> prompt ->agent_end)new_sessionacknowledgements by request IDWhy
PiVoiceLLMowns one long-livedPiClientand one response queue, while a xiaozhi connection uses a five-workerThreadPoolExecutorand submitsconn.chatjobs asynchronously. Two overlapping turns could therefore read from the same ordered Pi RPC stream, allowing one caller to consume another caller's frames.The reset path also accepted the first
new_sessionresponse regardless of request ID orsuccess. A stale failed response could complete the reset early and leave the correct acknowledgement queued for the next operation.A deterministic regression run against unmodified
mainreproduced the overlap (second turn must wait: two active prompts instead of one). The same test passes with this lock.Impact
Concurrent or rapidly interrupted voice turns now wait for the active Pi transaction to reach
agent_end. Reset acknowledgements cannot be confused with stale responses, and explicit Pi reset failures are logged through the provider's existing fallback path.Validation
ruff check .git diff --checkNo live-device claim is made; this PR validates the reachable race with a deterministic concurrency harness.