Skip to content

Server: close session on room noise, latest utterance wins, pre-warm voice model (#105, #181) - #204

Merged
BrettKinny merged 3 commits into
mainfrom
agent/overnight-1101
Nov 1, 2026
Merged

BrettKinny merged 3 commits into
mainfrom
agent/overnight-1101

Conversation

@BrettKinny

Copy link
Copy Markdown
Owner

Summary

Evidence

  • Unit tests: 826 passed (tests + custom-providers/pi_voice/tests), 316 passed (dotty-behaviour/tests). The new tests fail without the fixes.
  • Deployed to the tower at 22:07 (2026-11-01) and run through the overnight A/V regression (fw 1.3.4 and 1.3.5-dev, kid mode on and off): PiVoiceLLM ready, no regressions attributed to these commits.
  • ASR-NOISE-CLOSE count in all case logs: 0 (no false close on real prompts; real prompts scored no_speech <= 0.14, avg_logprob >= -0.89).
  • PiVoiceLLM prewarm ok in 1.2-1.5 s seen on several robot connects.

What is NOT proven

  • Noise close has never fired live. Zero hits, so the closing path itself (finding the connection, end_session, the mic closing) is only covered by unit tests with a stubbed closer. No false-positive check against a quiet child either.
  • Cold-start improvement is unmeasured. Every prewarm found the model already resident (1.2-1.5 s); nobody unloaded the model. The tower's llama-swap has ttl: 0 for qwen3.5:4b, so the 12 s cold start in the issue may have come from matrix eviction by another model, which pre-warm only partly helps.
  • Latest-wins has not been seen skipping a turn live (no skipping queued turn lines).
  • Clearly articulated TV speech still passes the noise signals; only a wake word or voiceprint separates it.
  • The 3-turn threshold and the noise definition are the maintainer's to confirm.
  • One pi process exited mid-turn at 03:32:43 was investigated: not caused by this PR (the whole dotty-* container set was stopped and restarted at that moment; pre-warm is a plain HTTP call that never touches the pi process, and latest-wins only decides before the lock).

Refs #105
Refs #181

AI-assisted: drafted and implemented by Claude (Opus 5.5); a human reviews and is accountable for what lands.

🤖 Generated with Claude Code

BrettKinny and others added 3 commits November 1, 2026 20:02
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>
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>
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>
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