Telegram: stream LLM replies via sendMessageDraft #652

Closed
opened 2026-10-27 13:37:12 +00:00 by sam · 0 comments
Owner

Chat replies currently block for the whole LLM turn, then arrive as one message. The typing indicator masks the wait but shows no progress. go-telegram/bot exposes SendMessageDraft (see examples/streaming_draft) and ai-sdk's runtime.ChatStream already returns core.StreamResult with a TextStream <-chan string, so both halves exist -- only the gateway seam is missing, since gateway.LLMResponder is func(ctx, Message) (string, error) and cannot emit partial output.

Acceptance Criteria

Gateway exposes an optional streaming responder; Router falls back to the blocking path when unset. Telegram adapter streams deltas into a draft, then finalises with a formatted SendMessage. Draft updates are throttled to respect Telegram rate limits. Streaming failure falls back to a normal send rather than losing the reply.


Imported from beads archie-core-1786637493099-127-80cacb10 · GitHub #148 · type feature · priority P2 · created 2026-08-08 · closed 2026-08-08

Chat replies currently block for the whole LLM turn, then arrive as one message. The typing indicator masks the wait but shows no progress. go-telegram/bot exposes SendMessageDraft (see examples/streaming_draft) and ai-sdk's runtime.ChatStream already returns core.StreamResult with a TextStream <-chan string, so both halves exist -- only the gateway seam is missing, since gateway.LLMResponder is func(ctx, Message) (string, error) and cannot emit partial output. ### Acceptance Criteria Gateway exposes an optional streaming responder; Router falls back to the blocking path when unset. Telegram adapter streams deltas into a draft, then finalises with a formatted SendMessage. Draft updates are throttled to respect Telegram rate limits. Streaming failure falls back to a normal send rather than losing the reply. --- _Imported from beads `archie-core-1786637493099-127-80cacb10` · GitHub #148 · type feature · priority P2 · created 2026-08-08 · closed 2026-08-08_
sam added the mediumfeature labels 2026-10-27 13:37:12 +00:00
sam self-assigned this 2026-10-27 13:37:12 +00:00
sam closed this issue 2026-10-27 13:37:12 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#652