Skip to content

[Fix] Telegram first messages lose attachments in new Sessions - #2586

Merged
roomote-roomote[bot] merged 3 commits into
developfrom
fix/telegram-first-turn-attachments-1s5erk4r3m9e6
Sep 12, 2026
Merged

[Fix] Telegram first messages lose attachments in new Sessions#2586
roomote-roomote[bot] merged 3 commits into
developfrom
fix/telegram-first-turn-attachments-1s5erk4r3m9e6

Conversation

@roomote-roomote

@roomote-roomote roomote-roomote Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

​Opened on behalf of @daniel-lxs. Follow up by mentioning @roomote-roomote, in the web UI, or in Telegram.

What changed

  • Preserve structured attachment text when Telegram schedules the first turn of a new Fast Session, including across durable retries.
  • Treat Telegram photos and supported image documents as valid image input even when Telegram reports a generic MIME type, while extracting text documents, transcribing audio and voice notes, and describing supported video documents within existing size limits.
  • Keep unsupported files undownloaded and document the supported Telegram attachment behavior.
  • Add first-session regression coverage for every supported attachment category, unsupported documents, immediate admission, and durable event delivery.

Why this change was made

Telegram appended extracted non-image content to the visible question but dropped the structured current-turn attachment payload at the shared Fast surface-reply boundary. That prevented the first Session turn from retaining the same attachment context used by Fast's explicit task attachment handoff.

Impact

The first Telegram message in a Fast Session now retains supported images and bounded non-image context through both immediate execution and queued retries. Task attachment forwarding remains explicit and default-off, while unsupported files, webhook idempotency, topic routing, and existing task-entry behavior are unchanged.

@roomote-community

roomote-community Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

No new code issues found. See task

  • apps/api/src/handlers/telegram/attachments.ts:101 filename-recognized image documents with generic MIME types are emitted as non-image data URLs and dropped before Fast forwarding.

Reviewed 5b0aa72

Comment thread apps/api/src/handlers/telegram/attachments.ts Outdated
@roomote-roomote

roomote-roomote Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

Resolved the outstanding image-document MIME fallback issue in 30a1c845. Generic Telegram/download MIME metadata now falls back to a valid image/png data URL, with focused regression coverage. See review task.

@roomote-roomote
roomote-roomote Bot marked this pull request as ready for review September 12, 2026 06:02
@roomote-roomote
roomote-roomote Bot merged commit 8e4fa43 into develop Sep 12, 2026
18 checks passed
@roomote-roomote
roomote-roomote Bot deleted the fix/telegram-first-turn-attachments-1s5erk4r3m9e6 branch September 12, 2026 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant