Skip to content

Audio: raw binary injected into context after successful transcription #5327

Description

@JustTrott

Problem

When a voice message is received and successfully transcribed via CLI STT (parakeet/sherpa-onnx), the raw audio binary (OGG/Opus) is still injected into the model context alongside the transcript. The binary bytes render as CJK/garbage characters and consume massive amounts of context tokens.

A short 10-second voice message adds ~15KB of binary garbage to context. A 40-second voice causes context overflow and triggers safeguard compaction, effectively crashing the session.

Expected behavior

After successful audio transcription, the raw audio binary should not be passed to the model — only the transcript text. Claude (and most text models) cannot process raw OGG binary, so it's pure context waste.

Suggested fix

Add a config option like tools.media.audio.stripRawOnSuccess: true (or make it the default) that removes the raw audio attachment from the model context when transcription succeeds. The current behavior (Preserve original media delivery to the model (always)) makes sense for images (vision models can use them) but not for audio with text-only models.

Reproduction

  1. Configure CLI-based audio transcription (e.g., parakeet-stt via sherpa-onnx)
  2. Send a voice message via Telegram
  3. Observe webchat — raw binary appears as Chinese/CJK characters in the message
  4. Send a longer voice (40+ seconds) — context overflows and compacts

Environment

  • OpenClaw 2026.1.29
  • Model: Claude Opus 4.5 (text-only, no native audio input)
  • STT: parakeet-stt (sherpa-onnx, CLI type)
  • Channel: Telegram

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions