feat(telegram): hand off audio/document files to the agent - #183
Open
AuYahyire wants to merge 4 commits into
Open
feat(telegram): hand off audio/document files to the agent#183AuYahyire wants to merge 4 commits into
AuYahyire wants to merge 4 commits into
Conversation
Allow self-hosted telegram-bot-api endpoints and larger voice downloads while keeping public api.telegram.org defaults unchanged. Co-authored-by: Cursor <cursoragent@cursor.com>
Long recordings arrive as Telegram audio or documents, not voice notes, and were ignored as empty_message. Download them to $PUSH_HOME/cache/inbound-audio and pass the path to the agent for local transcription instead of cloud STT. Co-authored-by: Cursor <cursoragent@cursor.com>
getFile returns absolute paths under telegram-bot-api --local; HTTP /file/bot… 404s for those paths. Read absolute paths with std::fs instead. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
audiomessages and audiodocumentfiles (long recordings) were ignored asempty_messagebecause Push only accepted text orvoicenotes.$PUSH_HOME/cache/inbound-audio/and handed to the agent with a short local-transcription prompt (no OpenAI STT, no spoken reply).--local,getFilemay return an absolute filesystem path that 404s over HTTP; absolute paths are read from disk instead.Why
Long phone recordings arrive as
audio/document, notvoice. Operators who want local transcription skills need Push to accept and download those files and pass the path to the agent, without pulling cloud STT into the gateway.Test plan
cargo fmt --all --checkcargo clippy --locked --all-targets -- -D warningscargo build --lockedcargo test --lockedcargo test parses_audio_and_audio_documentscargo test parses_voice_attachment~/.push/cache/inbound-audio/and agent starts local transcription[voice]is configuredRisks
feat/telegram-local-bot-api; the diff vsmainincludes those commits until feat(telegram): configurable Bot API base URLs and max audio size #181 merges. Please review/merge feat(telegram): configurable Bot API base URLs and max audio size #181 first (or review only the top commits: handoff + local-path read).telegram.max_audio_bytes; misconfiguration can exhaust disk under$PUSH_HOME/cache/inbound-audio/.getFilereturns an absolute path (local Bot API); cloud Bot API keeps the HTTP download path.Related issue
None (depends on #181)