docs(telegram): note the live-edit timestamp trade-off on liveReply

The finished reply is delivered by editing the message created at the
first streamed frame, and editMessageText does not change a
message's date, so a long tool-using turn's answer keeps its
turn-start timestamp and can sort before conversation that produced
it. Delete-and-resend would fix the ordering but reintroduce the
flicker/reorder streaming exists to avoid, so this documents the
accepted trade-off rather than changing behavior.
This commit is contained in:
sam committed 2026-08-15 01:48:33 +10:00
1 parent d43416f2fe
commit b6505f0232
1 file changed
+9
+9
View File
@@ -59,6 +59,15 @@ const (
// finalize writes when the turn completes -- if every live update failed,
// the user simply sees the finished message appear the way it did before
// streaming existed.
//
// A known, accepted trade-off of editing rather than sending: Telegram does
// not change a message's date on edit, so the finished reply carries the
// timestamp of the first streamed frame, not of finalize. A turn with a long
// tool phase can therefore produce an answer timestamped before a user
// message sent later, during that phase, and sort before the conversation
// that produced it. Delete-and-resend on finalize would fix the ordering but
// reintroduce the flicker/reorder streaming was built to avoid, so this is
// left as-is rather than "fixed."
type liveReply struct {
g *Gateway
b *bot.Bot