{"record":{"id":"2cac2202d3332e99","repo":"zeroclaw-labs/zeroclaw","slug":"audio-file-too-large-bytes-global-max","errorCode":null,"errorMessage":"Audio file too large ({} bytes, global max {})","messagePattern":"Audio file too large \\((.+?) bytes, global max (.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/zeroclaw-channels/src/transcription.rs","lineNumber":1173,"sourceCode":"                \"transcription: provider not configured\"\n            );\n            anyhow::Error::msg(format!(\n                \"Transcription transcription_provider '{transcription_provider}' not configured. Available: {available:?}\"\n            ))\n        })?;\n\n        self.enforce_global_audio_limit(audio_data)?;\n\n        use ::zeroclaw_log::Instrument;\n        let span = ::zeroclaw_log::attribution_span!(p.as_ref());\n        p.transcribe(audio_data, file_name).instrument(span).await\n    }\n\n    fn enforce_global_audio_limit(&self, audio_data: &[u8]) -> Result<()> {\n        if let Some(max_audio_bytes) = self.max_audio_bytes\n            && audio_data.len() > max_audio_bytes\n        {\n            bail!(\n                \"Audio file too large ({} bytes, global max {})\",\n                audio_data.len(),\n                max_audio_bytes\n            );\n        }\n        Ok(())\n    }\n\n    /// List registered transcription_provider names.\n    pub fn available_providers(&self) -> Vec<&str> {\n        self.transcription_providers\n            .keys()\n            .map(|k| k.as_str())\n            .collect()\n    }\n}\n\nimpl ::zeroclaw_api::attribution::Attributable for GroqProvider {","sourceCodeStart":1155,"sourceCodeEnd":1191,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-channels/src/transcription.rs#L1155-L1191","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Raise or remove transcription.max_audio_bytes to match the largest payload you intend to accept","Keep per-provider sizing in mind: the effective limit is min(global cap, provider cap), so both must allow the file","Reject oversized audio at the channel layer with a user-facing message instead of letting the manager throw"],"exampleFix":"# before\n[transcription]\nenabled = true\nmax_audio_bytes = 10485760  # 10 MB, rejects 12 MB voice notes\n\n# after\n[transcription]\nenabled = true\nmax_audio_bytes = 26214400  # 25 MB","handlingStrategy":"validation","validationCode":"// Mirror the configured global limit at the channel edge\nfn within_global_limit(audio: &[u8], max: Option<usize>) -> bool {\n    max.is_none_or(|m| audio.len() <= m)\n}","typeGuard":null,"tryCatchPattern":"match manager.transcribe(&audio, name).await {\n    Ok(text) => Some(text),\n    Err(e) if e.to_string().contains(\"global max\") => {\n        channel.reply(\"Voice note exceeds the configured transcription limit.\").await;\n        None\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Set transcription.max_audio_bytes deliberately — it gates every provider, including local_whisper","Pre-check size at ingest and reply to the user instead of letting the manager throw","Remember the effective cap is min(global, provider) — raise both when enlarging payloads"],"tags":["audio","file-size","config","transcription","pre-flight-check"],"backgroundTag":"file-size-limit-exceeded","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}