You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #2972 (commit cf308d6b) added auto-download for ChannelContent::File so agents receive a saved-on-disk path instead of a raw URL. The same treatment is missing for ChannelContent::Voice, which still flows through as [User sent a voice message ({Xs}): {url}] text — forcing the agent to download the audio itself before tools like media_transcribe can read it.
Repro
Send a Telegram voice note to any agent on a channel-bridged hand.
Observe the inbound prompt body contains the raw https://api.telegram.org/file/bot.../voice/file_N.oga URL.
The agent must curl the URL, then juggle workspace-allowed paths (/data/workspaces vs /tmp) before invoking media_transcribe or mcp_filesystem_read_file. The web_fetch tool also rejects the host in some configs.
Expected
Voice messages should mirror the File path: stream-download to channels.file_download_dir (default <tempdir>/librefang_uploads), respect channels.file_download_max_bytes, and dispatch a [File: voice.ogg] saved to /tmp/librefang_uploads/<id>.ogg block (plus a Text block carrying the caption + duration if either is present). media_transcribe then works end-to-end against the saved path with no agent-side curl.
Code pointers
Voice text-only formatter: `crates/librefang-channels/src/bridge.rs` ~line 2682 (`ChannelContent::Voice` arm in `dispatch_message`).
File download arm to mirror: same file, ~line 2506.
Helper to reuse: `download_file_to_blocks` (~line 3492) — takes `url`, `filename`, `max_bytes`, `download_dir`. Filename can be derived from the URL path basename, falling back to `voice.ogg`.
Existing test fixture: `test_content_to_text_voice` (~line 5300) — add a parallel `test_voice_dispatch_downloads` exercising the new path.
Caption preservation matters: today's text formatter appends ` {caption}` after the URL line. The downloaded-block path should emit a separate `ContentBlock::Text { text: caption }` so it's not lost in the saved-path block.
Same gap likely applies to `ChannelContent::Video` / `ChannelContent::Audio` — worth scoping in the same PR if cheap, otherwise file as follow-ups.
Happy to send a PR — drafting now against `upstream/main`.
Summary
PR #2972 (commit
cf308d6b) added auto-download forChannelContent::Fileso agents receive a saved-on-disk path instead of a raw URL. The same treatment is missing forChannelContent::Voice, which still flows through as[User sent a voice message ({Xs}): {url}]text — forcing the agent to download the audio itself before tools likemedia_transcribecan read it.Repro
https://api.telegram.org/file/bot.../voice/file_N.ogaURL.curlthe URL, then juggle workspace-allowed paths (/data/workspacesvs/tmp) before invokingmedia_transcribeormcp_filesystem_read_file. Theweb_fetchtool also rejects the host in some configs.Expected
Voice messages should mirror the File path: stream-download to
channels.file_download_dir(default<tempdir>/librefang_uploads), respectchannels.file_download_max_bytes, and dispatch a[File: voice.ogg] saved to /tmp/librefang_uploads/<id>.oggblock (plus a Text block carrying the caption + duration if either is present).media_transcribethen works end-to-end against the saved path with no agent-side curl.Code pointers
Notes
Happy to send a PR — drafting now against `upstream/main`.