Skip to content

fix: raise error when audio recording URL is inaccessible (TH-4734)#216

Merged
KarthikAvinashFI merged 1 commit intodevfrom
fix/th-4725-audio-url-accessibility-error
May 5, 2026
Merged

fix: raise error when audio recording URL is inaccessible (TH-4734)#216
KarthikAvinashFI merged 1 commit intodevfrom
fix/th-4725-audio-url-accessibility-error

Conversation

@KarthikAvinashFI
Copy link
Copy Markdown
Contributor

Summary

Raise a user-facing error when an audio recording URL is not accessible, instead of silently treating it as text.

Problem

When external audio URLs return 403/inaccessible, detect_input_type() returns 'file'. Since 'file' is not in _SUPPORTED_MEDIA, the URL passes through as plain text to the LLM — producing meaningless eval results.

Fix

In the shared media detection path (llm_payloads.py), when type is 'file' and URL has an audio extension (.wav, .mp3, etc.), raise:

"Audio recording is not accessible for '{key}'. The file could not be downloaded — please ensure the recording URL is valid and accessible."

Test plan

  • Pass an inaccessible audio URL → error raised with friendly message
  • Pass an accessible audio URL → processed as audio normally
  • Pass a non-audio URL that returns 403 → no error (only audio extensions trigger it)

@KarthikAvinashFI KarthikAvinashFI force-pushed the fix/th-4725-audio-url-accessibility-error branch from b72da3c to b25a51f Compare May 5, 2026 09:20
@KarthikAvinashFI KarthikAvinashFI changed the base branch from dev to main May 5, 2026 09:46
@KarthikAvinashFI KarthikAvinashFI force-pushed the fix/th-4725-audio-url-accessibility-error branch from b25a51f to e476617 Compare May 5, 2026 09:52
When detect_input_type returns 'file' for a URL with audio extension
(.wav, .mp3, etc.), raise a user-facing ValueError instead of silently
passing the URL as plain text to the LLM. This prevents meaningless
eval results when recording URLs are not accessible.
@KarthikAvinashFI KarthikAvinashFI force-pushed the fix/th-4725-audio-url-accessibility-error branch from e476617 to 214625f Compare May 5, 2026 09:55
@KarthikAvinashFI KarthikAvinashFI changed the base branch from main to dev May 5, 2026 09:56
@KarthikAvinashFI KarthikAvinashFI merged commit 4e09685 into dev May 5, 2026
@KarthikAvinashFI KarthikAvinashFI deleted the fix/th-4725-audio-url-accessibility-error branch May 5, 2026 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants