Skip to content

feat(gateway): accept .epub in the document allowlist#12590

Open
handsdiff wants to merge 1 commit into
NousResearch:mainfrom
handsdiff:feat/epub-document-support
Open

feat(gateway): accept .epub in the document allowlist#12590
handsdiff wants to merge 1 commit into
NousResearch:mainfrom
handsdiff:feat/epub-document-support

Conversation

@handsdiff

Copy link
Copy Markdown
Contributor

Summary

  • Adds .epub → application/epub+zip to SUPPORTED_DOCUMENT_TYPES in gateway/platforms/base.py.
  • That single allowlist is consumed by every platform handler that caches uploaded documents (telegram, slack, discord, feishu, whatsapp), so this one-line addition lets users send .epub attachments on any of them.
  • Without it, the handlers reject epub uploads at the gateway — e.g. telegram replies with Unsupported document type '.epub' — even though the ocr-and-documents skill's marker extractor already lists EPUB as a first-class input alongside PDF/DOCX/PPTX/XLSX/HTML.
  • Updates tests/gateway/test_document_cache.py::test_expected_extensions_present parametrize list accordingly.

Test plan

  • pytest tests/gateway/test_document_cache.py (23 pass)
  • pytest tests/gateway/test_telegram_documents.py (34 pass)
  • Send a small .epub via Telegram to a running agent and confirm it's cached + readable by the ocr-and-documents skill

@handsdiff handsdiff force-pushed the feat/epub-document-support branch from 909378d to 9dcfbc7 Compare April 19, 2026 14:28
@handsdiff handsdiff force-pushed the feat/epub-document-support branch from 9dcfbc7 to 8da20c0 Compare April 19, 2026 22:11
@handsdiff handsdiff force-pushed the feat/epub-document-support branch from 8da20c0 to b75c189 Compare April 21, 2026 20:25
@alt-glitch alt-glitch added type/feature New feature or request comp/gateway Gateway runner, session dispatch, delivery labels Apr 21, 2026
@handsdiff handsdiff force-pushed the feat/epub-document-support branch from b75c189 to d28b022 Compare April 22, 2026 15:53
The allowlist in gateway/platforms/base.py (shared by telegram, slack,
discord, feishu, whatsapp) rejected .epub uploads before they reached the
agent, even though the ocr-and-documents skill's marker extractor already
handles epub (PDF/DOCX/PPTX/XLSX/HTML/EPUB). Add application/epub+zip so
the existing per-platform download/cache paths light up for epub too.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
handsdiff added a commit to handsdiff/hermes-agent that referenced this pull request Apr 24, 2026
Same shape as the epub addition (NousResearch#12590). ``SUPPORTED_DOCUMENT_TYPES``
in ``gateway/platforms/base.py`` is the single allowlist used by every
platform handler (telegram, slack, discord, feishu, whatsapp) to decide
whether to cache an uploaded document. It rejected ``.html`` uploads at
the gateway even though the ``ocr-and-documents`` skill's ``marker``
extractor already handles HTML alongside PDF/DOCX/PPTX/XLSX/EPUB.

Add both ``.html`` and ``.htm`` → ``text/html`` so users can share saved
web pages (Telegram's "share page as file" export, "Save As" HTML, email
attachments) and the agent can actually read them.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@handsdiff handsdiff force-pushed the feat/epub-document-support branch from d28b022 to 4c2733d Compare April 24, 2026 03:26
@TechFounder

Copy link
Copy Markdown

@alt-glitch when do you expect this to be merged? Thanks!

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 type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants