Skip to content

[Feature] Voice input — transcribe Slack audio messages #18

Description

@davesleal

Context

Slack mobile supports voice messages (audio clips). When sent to Shellack, the event arrives with empty text and the audio as a files attachment. The bot currently sends the empty text to the API, causing a 400 error: user messages must have non-empty content.

Error

anthropic.BadRequestError: Error code: 400 - messages.0: user messages must have non-empty content

Proposed fix

  1. Detect audio files in the Slack event (event.get("files", []) where filetype is mp4/webm/ogg/m4a)
  2. Download the audio via Slack API (files.info + authenticated URL)
  3. Transcribe using one of:
    • OpenAI Whisper API — $0.006/min, best accuracy, requires OpenAI key
    • Local Whisperwhisper CLI or faster-whisper Python, free, needs model download (~1.5GB)
    • Deepgram — real-time transcription API, pay-per-use
  4. Use transcript as prompt — feed to the agent as if the user typed it
  5. Post transcript as a thread reply so the user can verify what was understood

Immediate fix (before transcription)

At minimum, handle the empty-text case gracefully:

if not prompt.strip():
    if event.get("files"):
        app.client.chat_postMessage(
            channel=channel_id, thread_ts=thread_ts,
            text="Voice messages aren't supported yet — type your message or try again with text."
        )
        return

Priority

Medium — nice UX improvement for mobile users. The immediate graceful error should ship now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions