In a group with require_mention + mention_patterns, a captionless voice
note was dropped before speech-to-text ran: the mention gate only reads
text, and STT happens later in the runner, so saying the wake word could
never match (#102330). Typing it worked; saying it did not.
With the new opt-in `voice_mention_patterns: true`, a group voice note
that only a wake word could admit is transcribed at the gate and admitted
when the transcript matches. It is off by default because every
unaddressed voice note in the group would then go to the STT provider.
- One shared helper (gateway.platforms.helpers.spoken_mention_clips) and
one transcriber (run_inbound_transcription.transcribe_one_clip, the
runner's own per-clip STT + local fallback).
- Each gate takes a `spoken_mention` flag, so every other rule
(allowed_chats, topics, exclusive mentions, bot loop breaker,
free-response) still applies exactly as before.
- Wired on every adapter whose group gate reads mention_patterns from
text and receives voice: Telegram (new telegram_voice_mention sibling),
WhatsApp (Baileys), Photon and BlueBubbles.
- The turn reuses the gate's transcript by clip content (native admission
re-captures the clip under a new path), so STT runs once per note. A
note that does not match has its clip deleted.
Live on the Telegram stand-in with a real gateway and a local_command
STT: base drops the voice note (0 STT calls, no turn); head transcribes
once, admits it, and the model receives the spoken words. Non-matching
speech and the not-opted-in case stay dropped.
Based on #102369 by @astraltrekkin; not cherry-picked because its commits
conflict with current main on 5 files, and it turned the check on by
default.
Fixes#102330
Co-authored-by: astraltrekkin <164521089+rainbowgits@users.noreply.github.com>