zeroclaw-labs/zeroclaw · warning

Audio file too large ({} bytes, global max {})

Error message

Audio file too large ({} bytes, global max {})

What it means

TranscriptionManager::transcribe_with_provider() applies the manager-wide cap from transcription.max_audio_bytes before dispatching to any provider — this is the user-configured global limit, distinct from the hardcoded 25 MB cloud cap (error 282) and the per-provider local_whisper cap (error 292). It applies to every provider, including local_whisper. A None max (key absent) means no global check at all.

Source

Thrown at crates/zeroclaw-channels/src/transcription.rs:1173

                "transcription: provider not configured"
            );
            anyhow::Error::msg(format!(
                "Transcription transcription_provider '{transcription_provider}' not configured. Available: {available:?}"
            ))
        })?;

        self.enforce_global_audio_limit(audio_data)?;

        use ::zeroclaw_log::Instrument;
        let span = ::zeroclaw_log::attribution_span!(p.as_ref());
        p.transcribe(audio_data, file_name).instrument(span).await
    }

    fn enforce_global_audio_limit(&self, audio_data: &[u8]) -> Result<()> {
        if let Some(max_audio_bytes) = self.max_audio_bytes
            && audio_data.len() > max_audio_bytes
        {
            bail!(
                "Audio file too large ({} bytes, global max {})",
                audio_data.len(),
                max_audio_bytes
            );
        }
        Ok(())
    }

    /// List registered transcription_provider names.
    pub fn available_providers(&self) -> Vec<&str> {
        self.transcription_providers
            .keys()
            .map(|k| k.as_str())
            .collect()
    }
}

impl ::zeroclaw_api::attribution::Attributable for GroqProvider {

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Raise or remove transcription.max_audio_bytes to match the largest payload you intend to accept
  2. Keep per-provider sizing in mind: the effective limit is min(global cap, provider cap), so both must allow the file
  3. Reject oversized audio at the channel layer with a user-facing message instead of letting the manager throw

Example fix

# before
[transcription]
enabled = true
max_audio_bytes = 10485760  # 10 MB, rejects 12 MB voice notes

# after
[transcription]
enabled = true
max_audio_bytes = 26214400  # 25 MB
Defensive patterns

Strategy: validation

Validate before calling

// Mirror the configured global limit at the channel edge
fn within_global_limit(audio: &[u8], max: Option<usize>) -> bool {
    max.is_none_or(|m| audio.len() <= m)
}

Try / catch

match manager.transcribe(&audio, name).await {
    Ok(text) => Some(text),
    Err(e) if e.to_string().contains("global max") => {
        channel.reply("Voice note exceeds the configured transcription limit.").await;
        None
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: transcribe()/transcribe_with_provider() with transcription.max_audio_bytes set to a positive value and audio_data.len() exceeding it. E.g. max_audio_bytes = 10485760 (10 MB) while a voice note is 12 MB — rejected before any provider is contacted, even if the provider itself would accept it.

Common situations: A conservative global limit set for one provider (small Groq tier) now blocking local_whisper traffic that could handle more; forgetting the global key exists and only adjusting local_whisper.max_audio_bytes; ops tightening limits and long-file users immediately hitting it.

Related errors


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/2cac2202d3332e99. Report an issue: GitHub.