fix(conversation,voice_worker): going on survives the answer starting, ignores empty finals; cancel checks before every model call; context finals stay batched

- A speaker who starts their next utterance within call.continueMs holds their request open for
  that final, also if the answer starts playing meanwhile; an empty final (rejected noise) joins
  nothing and asks nothing again
- The engine checks the cancel before the tool router, the planner and a planned tool call too
- Finals with a context are batched again: each context is cut from its end to the shortest one in
  the batch (ctranslate2 needs the start token at one position); ten finals at once 1.3 s
- Measured harsh conditions (docs/v2/stt-accuracy-plan.md): the context never made them worse

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-19 20:30:29 +09:00
parent c1b561d66d
commit 251f5e116d
7 changed files with 193 additions and 35 deletions

View File

@@ -171,8 +171,9 @@ decoded with the recent conversation as its previous-text prompt:
was kept, it stays within half that text's letters of it, and it holds every hotword exactly as
often; otherwise the text without context is used. On noise or unsure audio the prompt makes
Whisper write words of the conversation; this rule keeps that out, as for the hint.
- Prompts of different lengths cannot share one decoder call, so finals with a context are decoded
one clip at a time (the encoder costs the same per clip).
- Finals stay batched. The decoder needs the start token at the same position in every prompt of a
batch, so each clip's context is cut from its end to the shortest one in the batch (a channel's
clips share most of it); a clip without a context borrows another's and keeps its plain result.
Measured (2026-11-19, the game PC's RTX 5070 Ti with Strata loaded, large-v3-turbo int8_float16,
beam 2, the 100 recordings of the user's speech from 2026-11-16 to 19, 16 of them with the user's own
@@ -180,7 +181,11 @@ text): character error rate 12.0% without and 7.5% with the context (wrong sente
empty results (17 of 100 both ways), final decode 134 ms to 182 ms on average (p95 170 to 253 ms).
On the 108 noise clips decoded straight (no VAD), as many came out with text with the context as
without it (16 each); without the rule above it was 22 with turbo, and with large-v3 63, which wrote
whole sentences of the prompt. Evidence and the model comparison: `docs/v2/stt-accuracy-plan.md`.
whole sentences of the prompt. Under harsh copies of the same recordings (a weak voice over a mic
noise floor, ESC-50 noise at SNR 10 and 5 dB, a 300-3400 Hz headset, Opus 12 kbps, reverb) the
context never made the error rate worse (it fell most with Opus and reverb). Ten finals at once stay
one batch: 1.3 s with contexts, 1.6-2.0 s without (Strata running). Evidence and the model comparison:
`docs/v2/stt-accuracy-plan.md`.
Measured (2026-11-11, RTX 5050) with 54 real noise recordings from ESC-50 (typing, mouse, breathing,
coughing, laughing, crying, vacuum, ...), each at its own level and at -25 dBFS: of the 108 noise-only