Skip to content

[Task]: Add forwarded message author context to Telegram prompts #19

Description

@crankshift

Summary

Implement Telegram forwarded message author support so OpenCode receives clear author context for forwarded messages. If Telegram does not provide a forwarded author, treat the authorized Telegram user as the message author.

Context

Telegram can include original author information when a user forwards a message to the bot. The gateway should preserve that attribution when sending prompts to OpenCode so the AI can distinguish between the person forwarding the message and the original author. The implementation should keep Telegram-specific details inside the Telegram adapter and pass messenger-neutral author context into core prompt handling.

Acceptance Criteria

  • Forwarded Telegram messages include safe author context in the prompt sent to OpenCode.
  • Non-forwarded messages default to the authorized Telegram user as the author.
  • Missing, hidden, or unavailable forwarded author data falls back safely without leaking raw Telegram payloads.
  • Core gateway interfaces remain messenger-neutral and do not expose grammY/Telegram types.
  • Tests cover forwarded messages with author data, forwarded messages without author data, and normal user-authored messages.

Notes

Keep user-facing and persisted data safe. Do not store raw Telegram payloads or private identifiers unless there is a concrete need.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions