Skip to content

fix: support large Telegram documents - #26575

Closed
ponomr wants to merge 4 commits into
NousResearch:mainfrom
ponomr:fix/large-telegram-documents
Closed

fix: support large Telegram documents#26575
ponomr wants to merge 4 commits into
NousResearch:mainfrom
ponomr:fix/large-telegram-documents

Conversation

@ponomr

@ponomr ponomr commented May 15, 2026

Copy link
Copy Markdown

Summary

  • Use configurable Telegram max_document_mb instead of hardcoded 20 MB
  • Avoid passing document download/limit errors into the LLM as user text
  • Copy local Bot API files directly in local_mode to avoid large download timeouts
  • Increase document fetch/download timeouts for large files

Test Plan

  • python -m py_compile gateway/platforms/telegram.py
  • Restarted bizbot gateway and verified Telegram connection

@ponomr
ponomr requested a review from a team May 15, 2026 20:43
@alt-glitch alt-glitch added type/feature New feature or request P2 Medium — degraded but workaround exists platform/telegram Telegram bot adapter comp/gateway Gateway runner, session dispatch, delivery comp/tools Tool registry, model_tools, toolsets labels May 15, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Closing — overlaps with the just-merged #28527 (salvage of #25280 'skip-STT audio path + 2GB cap via local Bot API server') and has fork-specific issues:

  1. Duplicate mechanism: Both PRs add a configurable document-size cap. feat(telegram): skip-STT audio path + 2GB cap via local Bot API server #25280 uses an automatic 2GB cap when extra.base_url is set (presence of locally-hosted Bot API server is the opt-in). Your PR adds an explicit max_document_mb config. The 2GB-on-base_url approach is simpler — operators who configure a local Bot API already opt in via that.

  2. Russian user-facing strings: The new size-limit error messages are in Russian ("Не смогла проверить...", "Документ слишком большой..."). Upstream needs English by default; localization should go through a translation layer.

  3. Unrelated bundled commits: Your PR also adds tools/pdf_compress_tool.py (241 LOC) and tools/office_extract_tool.py (319 LOC) which are independent features deserving their own PRs.

The local Bot API file-copy optimization you mention in the summary IS still uncovered — that would be a clean follow-up PR. The English version of "document too large" error messaging would also be welcome. Thanks for the work.

@teknium1 teknium1 closed this May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery comp/tools Tool registry, model_tools, toolsets P2 Medium — degraded but workaround exists platform/telegram Telegram bot adapter type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants