fix(audio): handle voice message failures gracefully

- Send user feedback when voice/audio download fails instead of silent failure
- Send graceful message when audio transcription is not configured instead of empty text which crashes API
This commit is contained in:
William Valentin
2026-02-11 19:44:42 -08:00
parent 5c531a760d
commit 2e235213d9
2 changed files with 5 additions and 0 deletions
+3
View File
@@ -254,6 +254,9 @@ export function createMessageRouter(deps: {
const transcript = await transcribeAudio(att, audioConfig);
messageText = `[Voice message]: ${transcript}\n\n${messageText}`;
}
} else {
// No transcription endpoint configured — inform the user gracefully
messageText = `[Voice message received but audio transcription is not configured. Please configure the audio section in config.yaml to enable voice message support.]`;
}
// Remove audio attachments so buildUserMessage doesn't create audio content parts
attachments = (msg.attachments ?? []).filter((a: Attachment) => !isSupportedAudio(a));