Skip to content

test(e2e): live-server voice-recognition gate test#10324

Merged
mudler merged 1 commit into
masterfrom
test/realtime-voice-gate-e2e
Jun 13, 2026
Merged

test(e2e): live-server voice-recognition gate test#10324
mudler merged 1 commit into
masterfrom
test/realtime-voice-gate-e2e

Conversation

@localai-bot

Copy link
Copy Markdown
Collaborator

What

Follow-up to the realtime voice-recognition gate (already merged): a live-server e2e that exercises the gate end to end through the real HTTP/WebSocket stack.

It drives httpapi.API/v1/realtime (WebSocket) → runRealtimeSessionnewVoiceGate (real gRPC to a speaker backend) → commitUtteranceAuthorize (real gRPC) → the hard barrier before the LLM.

How

No GPU or real models needed. The existing tests/e2e mock-backend gains two RPCs:

  • VoiceEmbed / VoiceVerify with a deterministic, resampling-robust speaker discriminator: the signed DC offset of the audio maps to one of two orthogonal unit embeddings. A positive bias is the enrolled (authorized) speaker; a negative bias is a different (unauthorized) one.

A mock-speaker model and a verify-mode realtime-pipeline-gated model are added to the suite (verify mode enrolls a reference WAV at model load, so it needs no registry/store backend and runs fully in-process).

Specs (tests/e2e/realtime_voicegate_test.go)

  • Authorized speaker (positive-DC audio matching the reference) → reaches response.done, no reject event.
  • Unauthorized speaker (negative-DC audio) → speaker_not_authorized event and no response.done (dropped before the LLM).

Verified on latest master: 2 Passed | 0 Failed, and the full Realtime label still green (no regressions). Logs confirm each real step (reference enrolled at load, per-utterance embed over gRPC, gate allow/reject).

Assisted-by: Claude:opus-4.8 [Claude Code]

Add mock-backend VoiceEmbed/VoiceVerify (deterministic DC-offset speaker
discrimination) and a verify-mode gated realtime pipeline, then drive the
real HTTP/WS stack: an authorized speaker reaches response.done while an
unauthorized one is dropped before the LLM with a speaker_not_authorized
event.

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Assisted-by: Claude:opus-4.8 [Claude Code]
@mudler
mudler merged commit 4d3d54d into master Jun 13, 2026
19 of 21 checks passed
@mudler
mudler deleted the test/realtime-voice-gate-e2e branch June 13, 2026 21:54
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.

2 participants