ductor icon indicating copy to clipboard operation
ductor copied to clipboard

[Bug]: Telegram replies don't include cited message in agent context

Open Aut0-Mat opened this issue 6 months ago • 1 comments

What happened?

When I reply to a Ductor bot message in Telegram (using the native "Reply" UI gesture), the cited message text isn't included in what the agent receives. The agent only sees my new message, without the quoted content. This breaks the natural drill-down workflow on bot-generated content.

Steps to Reproduce

  1. In any Ductor-connected Telegram topic, have any bot-generated message (cron output, heartbeat response, manual agent reply)
  2. Use Telegram's native Reply gesture on that message (long-press → Reply on mobile, or right-click → Reply on desktop)
  3. Type a short follow-up like "expand on this" or "tell me more about point 2"
  4. The agent's response shows no awareness of the cited content

Expected Behavior

When my message has a reply_to_message, the cited content should be available to the agent — either prepended to the prompt as a quote block, or injected into the session memory before processing.

Operating System

Linux

Ductor version

v0.17.0

Additional context

This is related to but distinct from PR #122 (draft, "fix Telegram reply context mixing") which addresses the case where reply context is mixed with the wrong session. The case here is simpler: reply context is just lost.

Workaround today is copy-pasting the original message into the reply, which defeats the purpose of Telegram's native gesture and is fragile on long messages. Combined with the limitation that cron output doesn't enter session memory (related feature request), drill-down workflows on bot-generated content currently require a lot of manual copy-paste.

Before submitting

  • [x] I have searched existing issues and bug reports for duplicates.

Aut0-Mat avatar May 18 '26 16:05 Aut0-Mat

Fixed in v0.18.1. Replying to a message now carries the cited text into the agent prompt with explicit labels, preferring the highlighted quote fragment (Bot API 7.0+) over the full message. It also works when the reply isn't text — a voice/photo/video reply prepends the quote plus an attachment-type note ahead of the file block, so the agent knows what the voicemail/image is responding to. Thanks for the clear report.

Release: https://github.com/PleasePrompto/ductor/releases/tag/v0.18.1

PleasePrompto avatar Jun 13 '26 05:06 PleasePrompto