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
{{ message }}
Repository navigation
fix(telegram): caption-less media messages crash with ChatMessage ValidationError (content min_length=1) #10483
For a caption-less photo / document / voice / video / audio message, text == "". ChatMessage.content is Field(..., min_length=1, ...) (api/schemas_chat.py:463), so constructing it raises pydantic ValidationError.
Impact
Every caption-less media message received via the Telegram bot raises ValidationError in handle_telegram_update, so the message is not routed to chat and no reply is sent — the common case (sending a photo/voice with no caption) is broken.
When unified_message.message is empty but metadata.get("has_file") is set, synthesize a placeholder content naming the attachment, e.g. f"[{file_type} attachment]", before constructing ChatMessage. The Telegram adapter already records file_type/mime_type in metadata (telegram_adapter.py:48-53).
Found while fixing the equivalent WhatsApp bug (#10481) during verification of umbrella #9928.
Fixed in PR #10486 (merged to Dev_new_gui): caption-less Telegram media now gets a [<file_type> attachment] placeholder so ChatMessage construction no longer raises ValidationError. Regression test added (api/telegram_bot_test.py, 10 passed).
Activity
fix(telegram): placeholder content for caption-less media — avoid Cha…
mrveiss commentedon Jun 23, 2026
Fixed in PR #10486 (merged to Dev_new_gui): caption-less Telegram media now gets a
[<file_type> attachment]placeholder so ChatMessage construction no longer raises ValidationError. Regression test added (api/telegram_bot_test.py, 10 passed).