Skip to content

fix: voice messages silently dropped when STT is not configured #251

@shaun-agent

Description

@shaun-agent

Description

When a user sends a Discord voice message and STT is disabled (stt.enabled = false or unconfigured), the bot silently drops it — no reaction, no reply. The user thinks the bot is broken.

Root cause: Two bugs in src/discord.rs:

  1. Audio skip is logged at debug!() level only — operators don't notice it in production logs.
  2. Voice-only messages (no text, just audio) pass the empty-check guard because prompt_with_sender always includes the <sender_context> XML block. The agent receives a prompt with only sender context and no actual content, producing confusing or empty responses.

Prior Art

Project File Behavior when STT unconfigured
OpenClaw audio-preflight.ts Transcribes before mention check; no explicit "STT off" feedback — audio is simply not processed
Hermes Agent transcription_tools.py Local/Groq/OpenAI fallback chain; no explicit "STT off" feedback — audio is simply not processed
openab (current) src/discord.rs debug!() log, silent skip, empty prompt sent to agent

Neither OpenClaw nor Hermes Agent provides user-facing feedback when STT is unavailable. This is a gap we can fill.

Design

Approach: React with 🎤 emoji + early return for voice-only messages.

Rationale:

  • Consistent with existing 🚫 pattern for denied users (react on original message, don't reply)
  • Zero channel noise — no extra messages cluttering threads
  • Self-explanatory: "I see your mic, but I can't do anything with it"
  • Operators get warn!() level logs for visibility

Behavior matrix:

Message type STT enabled STT disabled
Voice only Transcribe → process React 🎤 → early return
Voice + text Transcribe → process all React 🎤 → process text only
Voice + image Transcribe → process all React 🎤 → process image only
Text only Process Process

Files Changed

File Change
src/discord.rs Add warn import, track audio_skipped flag, react 🎤, early return for voice-only

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdiscordp3Low — nice to have

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions