Skip to content

[Bug]: Telegram incoming image files treated as document uploads #18620

@laydros

Description

@laydros

Bug Description

On Telegram, Hermes handles normal photo uploads, but rejects image files sent as Telegram documents (for example a PNG sent "without compression") as unsupported documents.

This means the same visual content works when sent through Telegram's photo path, but fails when sent through Telegram's document path.

Steps to Reproduce

  1. Open Hermes via Telegram DM
  2. Send image as normal photo → works
  3. Send same/similar image as file/document (“without compression”) → fails
  4. Observe .png / .jpg unsupported-document error

Expected Behavior

If an inbound Telegram document is actually an image (.png, .jpg, .jpeg, .webp, or broadly image/*), Hermes should route it through the same image intake path used for normal Telegram photos.

At minimum, image documents should not be rejected as unsupported generic documents.

Actual Behavior

Hermes responds with:

Unsupported document type '.png'. Supported types: .cfg, .csv, .docx, .ini, .json, .log, .md, .pdf, .pptx, .toml, .txt, .xlsx, .xml, .yaml, .yml, .zip

The image never reaches the image/vision path.

Affected Component

Gateway (Telegram/Discord/Slack/WhatsApp)

Messaging Platform (if gateway-related)

Telegram

Debug Report

https://paste.rs/gTOni

Operating System

Debian 12

Python Version

3.11.14

Hermes Version

0.12.0

Additional Logs / Traceback (optional)

Successful photo path:


[Telegram] Cached user photo at /home/laydros/.hermes/image_cache/img_65260e8b663d.jpg
[Telegram] Flushing photo batch agent:main:telegram:dm:701334181:photo-burst with 1 image(s)
Image routing: text (mode=text). Pre-analyzing 1 image(s) via vision_analyze.


Failing document path:


[Telegram] Unsupported document type: .png
inbound message: platform=telegram user=laydros chat=701334181 msg="Unsupported document type '.png'. Supported types: .cfg, .csv, .docx, .ini, .jso"

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/gatewayGateway runner, session dispatch, deliveryduplicateThis issue or pull request already existsplatform/telegramTelegram bot adaptersweeper:implemented-on-mainSweeper: behavior already present on current maintype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions